According to Chapter 10 of the JSDK 2.2 spec, an extension mapping should
override any other mapping and route the request ending in the extension to
the appropriate servlet. Yet, the following URL doesn't work:
The above URL is resolved by the ROOT context (with a context path of ""),
rather than your own "augatservlet" context. Unless you add the "*.jweb"
mapping to $TOMCAT_HOME/webapps/ROOT/WEB-INF/web.xml as well, it will not be
recognized within this app.
If I add the automatic context generated by Tomcat, it does work:
Am I missing something? This behavior seems to contradict the examples in
It actually does work correctly. The key to remember is that you are defining
behavior only within a particular web application. Two different web apps in
the same instance of Tomcat can legally have different mappings for the same
extension, for example.
Also, the same chapter from the JSDK spec also says that by creating a
mapping that conatins only "/", that mapping becomes the default mapping for
the servlet container. Yet this does not appear to function in Tomcat.
Should it? Am I doing something wrong?
In which version of Tomcat are you doing your testing? In Tomcat 3.1 this is the
technique used to serve static files. I haven't tried it under 3.2beta2 (which
used a different technique), but I know it works correctly under Tomcat 4.0
(currently being developed) as well.