tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Are servlet name and class name required in web.xml for tomcat 5.5?
Date Wed, 25 Jan 2006 16:13:11 GMT

 -------------- Original message ----------------------
From: "Alla Winter" <>
> For Tomcat 4.x I didn't have to set up anything in web.xml.  But it seems
> that I have to define each servlet name and corresponding class name in
> web.xml in order to make it to work for Tomcat 5.5.  Is that right
> statement? 
> I have a lot of servlets, it seems like it is a lot of work.
> Can not find what info is required in web.xml and what is optional? Can you
> please refer me to that info?
> Thanks 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Yes, that is correct. Within the <servlet> element you must have the <servlet-name>
element, which can be any unique name you want, and the <servlet-class> element which
has the real class name. Then within the <servlet-mapping> element you must have a <servlet-name>
which is the same as one of the names from the <servlet> section, and you must have
a <url-pattern> element which tells Tomcat the url pattern that it will map to the identified
servlet. Here is an example for a servlet called "Login":



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message