That's because you're using the InvokerInterceptor that is mapped to all
/servlet/ requests.

In your server.xml file you'll see the entry:
        <RequestInterceptor 
            className="org.apache.tomcat.request.InvokerInterceptor" 
            debug="0" prefix="/servlet/" />

It is just a handy tool to use during development that allows you to
call any servlet without having to register it in <servlet-mapping>. 
Apparently it accepts both the class name and the servlet name to invoke
a servlet.  For servlets that are defined within a package, you'd use 
http://localhost/mycontext/servlet/xxx.yyy.mypackage.Quiz (could be that
it must be http://localhost/mycontext/servlet/xxx/yyy/mypackage/Quiz,
not sure) with Quiz being in the appropriate sub-/sub-/subdirectory
under /WEB-INF/classes.

Most servlet-containers will have a similar mechanism, but I don't think
there's really a standard, so for production you'd better use the
standard <servlet-mapping> entries.

Luc Vanlerberghe



Jacob Kjome wrote:
> 
> 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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to