File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help. Tomcat installed - can't see servlet

 
Ted Li
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Sam Dalton
Author
Ranch Hand
Posts: 170
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
boyet silverio
Ranch Hand
Posts: 173
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
wooddonkey Qian
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • 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>
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic