• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem deploying-accesing a single servlet webapp in Tomcat 5

 
Yan Lee
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<servlet-class>HelloServlet</servlet-class>


The servlet must be in a package other than the default.
 
satish sathineni
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<url-pattern>/HelloServlet/</url-pattern>

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

That should recognize ur servlet...

regards
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic