wood burning stoves 2.0*
The moose likes Servlets and the fly likes tomcat can't find servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "tomcat can Watch "tomcat can New topic
Author

tomcat can't find servlet

ricky gonzalez
Ranch Hand

Joined: Jun 30, 2000
Posts: 167
Hi, I made a simple servlet call SomeServlet and placed its class file in c:\tomcat\webapps\test\Web-inf\classes, but when I called http://127.0.0.1:8080/test\SomeServlet, tomcat could not find it.
Can anyone please help me?
Thanks.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
ricky,
Tomcat follows Servlet 2.2 spec in which the directory structure of a web application is standardized. Frank already posted it here. http://www.javaranch.com/ubb/Forum7/HTML/000559.html Please take a look at it. There are 2 ways to invoke a servlet from a browser.
1. with alias http://localhost:8080/test/SomeServlet
2. the standard way of http://localhost:8080/test/servlet/SomeServlet
In the first case you have to add an alias in the '...\test\WEB-info\web.xml' file like this.
I prefer the 2nd standard way for simple servlets which are not inside a loooooong package so that we can just type http://localhost:8080/test/servlet/SomeServlet like that.
Try to call this way. Tomcat will surely be able to call the servlet. Also please note that the url which we type in the browser address bar is case-sensitive. 'someServlet' is different from 'SomeServlet'
regds
maha anna

[This message has been edited by maha anna (edited October 15, 2000).]
ricky gonzalez
Ranch Hand

Joined: Jun 30, 2000
Posts: 167
Thank you so much maha!!
 
jQuery in Action, 2nd edition
 
subject: tomcat can't find servlet
 
Similar Threads
Nubmer of servlet instance
tomcat4
How to change the URL when the servlet forwards the page?
tomcat
command to run a cron job