tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <jacob.r.kj...@syntegra.com>
Subject curious behavior - pseudo servlet-mapping with mod_jk
Date Wed, 03 Jan 2001 15:34:12 GMT

I just noticed something that seems to work for me, but I can't determine 
quite why?  Maybe someone can confirm that this is expected behavior or 
not.....

I am running Tomcat 3.2.1 on Windows 2000

It seems that if you have a servlet registered in web.xml like this:

<servlet>
	<servlet-name>quiz</servlet-name>
	<servlet-class>Quiz</servlet-class>
</servlet>

AND you have the default values in mod_jk.conf:

JkMount /mycontext/*.jsp ajp13
JkMount /mycontext/servlet/* ajp13

you are able to access the above servlet at either of the following URL's:

http://localhost/mycontext/servlet/Quiz
http://localhost/mycontext/servlet/quiz

Notice the case difference in Quiz/quiz


It seems that the <servlet-name> provides a rudimentary amount of servlet 
mapping.

I tested this theory by changing the <servlet-name> to "quiza" and testing 
that.  After I did that, "Quiz" and "quiza" worked, but "quiz" did not.

NOTE:  This was done WITHOUT servlet mapping tags such as:

<servlet-mapping>
         <servlet-name>quiz</servlet-name>
         <url-pattern>/quiz</url-pattern>
</servlet-mapping>


So, it seems you can very simply (without complex servlet mappings) make 
your servlet case insensitive; that is in First letter upper case java 
style class naming syntax OR all lower case.


HOWEVER,

I am not sure if this is portable accross servers!!!!!!!!!

Can someone confirm that this isn't just a quirk of Tomcat?  Should it work 
this way based on the servlet spec????  Is it portable across servlet 
runners????  Does this work on Tomcat 4.0????


Jake


Mime
View raw message