wood burning stoves 2.0*
The moose likes Servlets and the fly likes servlet mapping issue? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet mapping issue?" Watch "servlet mapping issue?" New topic
Author

servlet mapping issue?

Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
Anyone familiar with this stuff that's showing up in my Tomcat stderr logs?
SEVERE: Parse Error at line 914 column 11: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-
................
In my web.xml, I have the following in my web-app element:

The one for my Controller servlet was already working (I finally figured that one out), and then I created the LoginLookup one, and it served to work when I access it in my website, but Tomcat seems to be complaining about it for some reason.
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
You need to define all your servlets before doing the servlet-mappings.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Its a good idea to download the servlet specification from here.
To get the exact details on the required order of elements in web.xml.
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Also, validating the XML document with a validating parser is a good idea so you don't have to wait until you deploy your application before you find out that it's all messed up. (I develop in JBuilder, where it's a simple context menu click or two.) Most, if not all, XML editors allow you to validate the document against some DTD these days.
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
I moved the following up above all the servlet mappings and it's still complaining:

<servlet>
<servlet-name>LoginLookup</servlet-name>
<servlet-class>wwxchange.LoginLookup</servlet-class>
</servlet>

<servlet>
<servlet-name>Controller</servlet-name>
<servlet-class>wwxchange.Controller</servlet-class>
</servlet>
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
How is it complaining? Have you validated your entire web.xml file and confirmed that it is well-formed?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet mapping issue?