This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Tomcat and the fly likes neewbie web.xml problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Products » Tomcat
Bookmark "neewbie web.xml problem" Watch "neewbie web.xml problem" New topic

neewbie web.xml problem

paul Staniland

Joined: Mar 03, 2008
Posts: 7
Hi all,

Just working through the Head First Servlets & JSP book and on chapter 3 where they walk you through deploying a simple web-app I seem to be having problems with the web.xml file. I've included the web.xml file at the bottom.
I've managed to compile the servlet class OK and tomcat is configured and recognising the HTML file but once I copy over the web.xml file from my MyProject/beerV1/etc directory to the tomcat/webapps/Beer-v1/WEB-INF directory and try and open form.html again I get a 404 error message. Also when starting up Tomcat again after copying the web.xml file it comes up with the line "Element type "web-app" must be declared" in the console.
I assume i'm missing off the classpath or something or my web.xml is wrong?

<web-app xmlns="" xmlns:xsi="" xsi:schemaLocaton="" version="2.4">
<servlet-name>Ch3 Beer</servlet-name>
<servlet-name>Ch3 Beer</servlet-name>
paul Staniland

Joined: Mar 03, 2008
Posts: 7
fixed the problem.

I was using Tomcat 4 and apparently that doesn't support web.xml 2.4 schema ... upgraded to Tomcat 5 and it's all working now.
Have you checked out Aspose?
subject: neewbie web.xml problem
It's not a secret anymore!