About Question enthuware.jwpv6.2.903 :

Moderator: admin

Post Reply
basamajoe
Posts: 21
Joined: Fri Apr 26, 2013 3:40 am
Contact:

About Question enthuware.jwpv6.2.903 :

Post by basamajoe »

What you mean with default servlet?

Would it be sth like <url-pattern>* OR /</url-pattern>?

Online
admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.903 :

Post by admin »

As per Section 12.2:
A string containing only the ’/’ character indicates the "default" servlet of the application. In this case the servlet path is the request URI minus the context path and the path info is null.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.

renatumb
Posts: 47
Joined: Mon Apr 08, 2013 7:55 pm
Contact:

Re: About Question enthuware.jwpv6.2.903 :

Post by renatumb »

If you have the following mappings:
/foo/bar/*    mapped to servlet1
*.bop    mapped to servlet4

Why the requests to /foo/bar/index.bop  will go to servlet1 ?

Online
admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.903 :

Post by admin »

This is because an extension mapping is considered ONLY if there is no path matching. Here, /foo/bar/index.bop does have a path matching with /foo/bar/*
If you like our products and services, please help us by posting your review here.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.903 :

Post by himaiMinh »

In the explanation, /catalog/index.html will go to default servlet.
I think / will go to the default servlet.
But I think /catalog/index.html will be mapped to an index.html file under /catalog directory of the web application. But if this index.html file does not exist, it will return a 404 error.

Online
admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.903 :

Post by admin »

Why do you think so?
If you like our products and services, please help us by posting your review here.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.903 :

Post by himaiMinh »

Hi, I tried this with Tomcat 8.
When /catalog/index.html (where catalog is a folder under the root of the web application) does not exist , it returns resource not found.

Online
admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.903 :

Post by admin »

Well, then probably tomcat 8 doesn't follow the specification because the text in the explanation is taken from Section 12.2.2 - "Example Mapping Set" of Servlet 3.0 specification.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests