| From | Sent On | Attachments |
|---|---|---|
| Ben Galbraith | Aug 23, 2000 3:26 pm | |
| Craig R. McClanahan | Aug 23, 2000 4:03 pm |
| Subject: | Re: Is Tomcat 3.1 fully compliant with JSDK 2.2? | |
|---|---|---|
| From: | Craig R. McClanahan (Crai...@eng.sun.com) | |
| Date: | Aug 23, 2000 4:03:32 pm | |
| List: | org.apache.tomcat.users | |
Ben Galbraith wrote:
Greetings.
I've deployed a web application in %TOMCAT_HOME%\webapps\augatservlet, and in webapps\augatservlet\WEB-INF\web.xml, I have the following entry (among others):
<servlet-mapping> <servlet-name> AuServlet </servlet-name> <url-pattern> *.jweb </url-pattern> </servlet-mapping>
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:
http://localhost:8080/MyPage.jweb
What am I missing?
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:
http://localhost:8080/augatservlet/MyPage.jweb
Am I missing something? This behavior seems to contradict the examples in 10.2.2.
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.
Thanks,
Ben
Craig McClanahan





