Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat can't find servlet

 
ricky gonzalez
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much maha!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic