Hi All,
Here is a question on
servlet mapping:
Consider the following code-snippet in the deployment-descriptor from the web-application SCWCD. To which rule will the following request URI map: /SCWCD/door/file.hall?
<!-- Rule 1 -->
<servlet-mapping>
<servlet-name>VauxHallServlet</servlet-name>
<url-pattern>/hall/*</url-pattern>
</servlet-mapping>
<!-- Rule 2 -->
<servlet-mapping>
<servlet-name>VauxHallServlet</servlet-name>
<url-pattern>/hall/hall/*</url-pattern>
</servlet-mapping>
<!-- Rule 3 -->
<servlet-mapping>
<servlet-name>VauxHallServlet</servlet-name>
<url-pattern>/door/*</url-pattern>
</servlet-mapping>
<!-- Rule 4 -->
<servlet-mapping>
<servlet-name>VauxHallServlet</servlet-name>
<url-pattern>*.hall</url-pattern>
</servlet-mapping>
1. Rule 1.
2. Rule 2.
3. Rule 3.
4. Rule 4.
5. Default servlet
The ans given is Rule 3 i-e VauxHallServlet.
It's obvious that 1 and 2 are incorrect.
But somehow, I can't figure out that why Rule 4 is not executed. Can anybody throw some light on this.
Thanks,
Reema