*
The moose likes Servlets and the fly likes Problem deploying-accesing a single servlet webapp in Tomcat 5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem deploying-accesing a single servlet webapp in Tomcat 5" Watch "Problem deploying-accesing a single servlet webapp in Tomcat 5" New topic
Author

Problem deploying-accesing a single servlet webapp in Tomcat 5

Yan Lee
Ranch Hand

Joined: Sep 15, 2003
Posts: 94
Hi,
When I run my webapp in Tomcat5 and try accessing my servlet using http://localhost:8080/HelloServlet/HelloServlet , I get a 404 error page stating that

HTTP Status 404 - /HelloServlet/HelloServlet
type Status report
message /HelloServlet/HelloServlet

description The requested resource (/HelloServlet/HelloServlet) is not available.
Apache Tomcat/5.0.19


The following is the servlet code:


The following is the web.xml



I am able to access index.jsp by using http://localhost:8080/HelloServlet/
What do I need to do to be able to access the servlet class?
Thanks in advance for the help.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

<servlet-class>HelloServlet</servlet-class>


The servlet must be in a package other than the default.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
satish sathineni
Ranch Hand

Joined: May 03, 2004
Posts: 46
<url-pattern>/HelloServlet/</url-pattern>

Try with the below url-pattern instead
<url-pattern>/HelloServlet</url-pattern>

That should recognize ur servlet...

regards
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem deploying-accesing a single servlet webapp in Tomcat 5