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 Servlets and the fly likes Getting error when loading servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Getting error when loading servlet" Watch "Getting error when loading servlet" New topic
Author

Getting error when loading servlet

Paul Mackellar
Greenhorn

Joined: Jun 03, 2010
Posts: 4
I have downloaded tomcat 6 and am running through a book which tells me to create a new project "ch1" with the classes and web-inf folders. I am trying to visit the servlet using localhost/ch1/Serv1 but keep getting the following error



My web.xml


can anyone help me to get this working?

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63208
    
  69

Place your servlet in a package other than the default.

As this is not Tomcat-specific, moved to the Servlets forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Paul Mackellar
Greenhorn

Joined: Jun 03, 2010
Posts: 4
I don't quite see what you mean.

My directory structure is tomcat>webapps> "ch1"which contains> classes and web-inf.

What should i do?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63208
    
  69

You're doing quite a few things wrong.

Firstly, it's WEB-INF, not web-inf. Case counts.

Secondly, the classes folder belongs in WEB-INF.

Thirdly, all classes in a web application must be in a package other than the default. If you are not familiar with Java packages, that's your first step.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Getting error when loading servlet
 
It's not a secret anymore!