> I'm trying to register a servlet so that I can invoke it like this:
>
> http://host/any-path/servletName
>
> rather than:
>
> http://host/servlet/servletName
>
> I've tried adding my servlet to my web.xml using <servlet-name> and
> <servlet-class>, but I still have to go through /servlet/ to
> get to it:
>
> <servlet>
> <servlet-name>secretServlet</servlet-name>
> <servlet-class>coreservlets.ProtectedPage</servlet-class>
> <init-param>
> <param-name>passwordFile</param-name>
>
> <param-value>C:\\tomcat\\webapps\\ROOT\\WEB-INF\\passwords.pro
> perties</param
> -value>
> </init-param>
> <load-on-startup>2</load-on-startup>
> </servlet>
>
> Any suggestions?
You also need to add servlet mappings. The
/servlet/MyServlet mapping is in the spec for backwards
compatibility. Take a look at the example web.xml(s)
to see how mappings work.
---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com