Page 1 of 1
About Question enthuware.jwpv6.2.903 :
Posted: Mon Jul 15, 2013 12:25 pm
by basamajoe
What you mean with default servlet?
Would it be sth like <url-pattern>* OR /</url-pattern>?
Re: About Question enthuware.jwpv6.2.903 :
Posted: Mon Jul 15, 2013 7:36 pm
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.
Re: About Question enthuware.jwpv6.2.903 :
Posted: Mon Nov 16, 2015 11:52 pm
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 ?
Re: About Question enthuware.jwpv6.2.903 :
Posted: Tue Nov 17, 2015 8:31 am
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/*
Re: About Question enthuware.jwpv6.2.903 :
Posted: Sat Jun 25, 2016 1:02 pm
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.
Re: About Question enthuware.jwpv6.2.903 :
Posted: Sat Jun 25, 2016 8:17 pm
by admin
Why do you think so?
Re: About Question enthuware.jwpv6.2.903 :
Posted: Sat Jun 25, 2016 10:34 pm
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.
Re: About Question enthuware.jwpv6.2.903 :
Posted: Sat Jun 25, 2016 11:52 pm
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.