2008-07-23

the jsp-config trap

There will be conflict if configure the servlet and jsp-config the same pattern as below :

<servlet-mapping>
  <url-pattern>/system/*</url-pattern>
</servlet-mapping>

<jsp-property-group>
  <url-pattern>/system/*</url-pattern>

if a request came, "/system/watch" for example, Tomcat will pass the request to the jsp container,
since jsp container cannot found any jsp fit this request, an http 404 would be returned.

I spent 3 hours and worked it out. here i list out some related resource :
1. the request process diagram
http://tomcat.apache.org/tomcat-6.0-doc/architecture/requestProcess.html
2. org.apache.catalina.core.StandardContext  : how the war context was loaded.