• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem deploying-accesing a single servlet webapp in Tomcat 5

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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



The servlet must be in a package other than the default.
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic