Page 1 of 1

About Question com.enthuware.ets.scwcd.v5.2.143 :

Posted: Thu Oct 09, 2014 12:37 pm
by bluster
Pardon my ignorance if this is thick, I am just starting my studies for this test.

It is stated on one of explanations that "You cannot start an extension mapping with a /."

However Appendix A of the JSP 2.0 spec, on "JSP.A.4 The Web Application Descriptor" provides an example:

Code: Select all

<servlet-mapping>
  <servlet-name> HelloWorld </servlet-name> 
  <url-pattern> /HelloWorld.jsp </url-pattern>
</servlet-mapping>
Is this a different case because it is a jsp or can we start with a "/"?

PS: My spec file is named jsp-2_0-fr-spec.pdf, "JavaServer PagesTM Specification Version 2.0". On this file the example above can be found on page 390 of 478.

Re: About Question com.enthuware.ets.scwcd.v5.2.143 :

Posted: Thu Oct 09, 2014 8:17 pm
by admin
/HelloWorld.jsp is not an extension mapping. It is an exact mapping.
As per section SRV 11.2 of Servlet 2.4 specification:
SRV.11.2 Specification of Mappings
In the Web application deployment descriptor, the following syntax is used to define
mappings:
• A string beginning with a ‘/’ character and ending with a ‘/*’ suffix is used
for path mapping.
• A string beginning with a ‘*.’ prefix is used as an extension mapping.
• 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.
• All other strings are used for exact matches only.

Re: About Question com.enthuware.ets.scwcd.v5.2.143 :

Posted: Fri Oct 10, 2014 10:37 am
by bluster
Thanks, it makes sense now.