tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Turning off /servlet/* mapping?
Date Fri, 01 Dec 2000 20:38:44 GMT
Thom Park wrote:

> I'm having Yet Another Servlet Mapping Problem.
> I'm trying to disable the /servlet/ mapping with my web-application. Here's the
> gist of what's happening.
>  My webapp is called "songs" it get's deployed according to J2EE specs. In the
> webapps folder there's a
> songs folder with an html file called songs_index.html.
> in songs\WEB-INF, I put my servlet into the classes folder (and some dependent
> jars in the lib folder).
> In web.xml I add the following:
> <servlet>
> <servlet-name>listSongs</servlet-name>
> <servlet-class></servlet-class>
> </servlet>

Add the following mapping in web.xml:


and the following URL will work:


You don't really need to "turn off" the default mapping -- what we are doing here is
defining a new one.  You should also know that the path used in a mapping need not
have the same name as your servlet class.  For instance, if you change the mapping
above to this:


then the correct URL would be



The rules for servlet mappings are found in the servlet API specification, which can
be downloaded from

Craig McClanahan

View raw message