Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Entries in Web.xml file

 
Padmaja Prasad
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike,
Thanks a lot... Its working fine now..
Thx
Kala
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic