• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Help. Tomcat installed - can't see servlet

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I just bought Manning book and start studying and tinkering around with tomcat
I am running Windows XP Pro, j2sdk 4.1, tomcat 4.1
I followed the instructions in Appendix A of
manning book. Tomcat seems to be running fine since I can view he default index.jsp file at
ROOT by
http://localhost:8080
I copied chapter01 files to webapp and try to view it by
http://localhost:8080/chapter01/servlet/HelloWorldServlet
and I get an error from Apache Tomcat.
http status 404 - /chapter01/servlet/HelloWorldServlet.
type status report
message /chapter01/servlet/HelloWorldServlet
description the requested resource (/chapter01/servlet/HelloWorldServlet) is not available
I checked my CATALINA_HOME, JAVA_HOME, CLASSPATH. file structure. I think everything is fine.
Help please...I am running out of things to check
 
Author
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suspect you should be able to access it at
http://localhost:8080/chapter01/HelloWorldServlet
If that does not work, check the web.xml file to find out which name HelloWorldServlet is mapped to.
Cheers
Sam
 
Ted Li
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried
http://localhost:8080/chapter01/HelloWorldServlet
and I get the same error. and I checked web.xml the <servlet-name> is the same "HelloWorldServlet"
Anybody has any other suggestions?
 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<quote>
I tried
http://localhost:8080/chapter01/HelloWorldServlet
</quote>
i think Sam's suggestion on seeing where '..HelloWorldServlet maps to.' is to look
for something like the following in your web.xml.
<servlet-mapping>
<servlet-name>HelloWorldServlet</servlet-name>
<url-pattern>/HelloWorldServlet</url-pattern>
</servlet-mapping>
if there isn't then try to append it after </servlet>, restart tomcat, and see how it works.
this associates the <url-pattern> with the <servlet-name> you defined in <servlet>...</servlet> so you can use the url you just tried.
hope this helps.
[ January 16, 2003: Message edited by: boyet silverio ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
add the following element to web.xml:
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
 
Die Fledermaus does not fear such a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic