wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Entries in Web.xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Entries in Web.xml file" Watch "Entries in Web.xml file" New topic
Author

Entries in Web.xml file

Padmaja Prasad
Ranch Hand

Joined: Nov 14, 2001
Posts: 76
Hi,
I'm facing trouble in starting the tomcat when I include more than one servlet in the web.xml file. But everything is working fine when I work with a sigle servlet. Can anyone help me what are the mandatory tags to be included in the web.xml file & their order??
Thanks in advance...
Kala Prasad
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

We need more information first.

What version of Tomcat? 3.x or 4.x ?

And your own code always helps, so post us the appropriate section of your web.xml (NOT the whole thing).

Also, the layout and requirements for web.xml are clearly layed out in both the DTD, and the example web.xml file in the examples/WEB-INF directory.

The DTD is your best place for information though, which can be found:
2.2 spec: http://java.sun.com/j2ee/dtds/web-app_2_2.dtd
2.3 spec: http://java.sun.com/j2ee/dtds/web-app_2_3.dtd
Padmaja Prasad
Ranch Hand

Joined: Nov 14, 2001
Posts: 76
I'm sorry..I forgot to mention the version. I'm using Tomcat v4.x.
my web.xml file looke like this:

when I start the Tomcat I receive the following error messages:

[ January 15, 2002: Message edited by: Mike Curwen ]
[ January 15, 2002: Message edited by: Mike Curwen ]
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

The clue is in the error message. You have something out of place, and the listing it gives you should tell you what it is.

But the answer is:
move the display-name element to the top. ie: it cannot be between two servlet elements
Padmaja Prasad
Ranch Hand

Joined: Nov 14, 2001
Posts: 76
Mike,
Thanks a lot... Its working fine now..
Thx
Kala
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Entries in Web.xml file
 
Similar Threads
Why doesnt eclipse generate a servlet mapping in web.xml
Eclipse web.xml servlet mapping?
tomcat 5 auto reload : Missing web.xml
Can request.getRequestDispatcher call a servlet?
Upgrading to Tomcat6 problems