This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Please help" Watch "Please help" New topic
Author

Please help

Yuan Ye
Ranch Hand

Joined: Mar 05, 2003
Posts: 172
I was trying to run a servlet program in Tomcat. I placed the compiled a.class file in the directory of WEBAPP/ROOT/WEB-INF/classes, however when I try to run http://localhost/servlet/a, Tomcat can't find the file. How should I set up the Tomcat so that this will work.
Thanks in advance.
Pravin Panicker
Ranch Hand

Joined: Oct 05, 2000
Posts: 62
I had this problem once. Though i dont have a solution, it worked when i put my servlet in a package.
Try putting class a in a package. Copy to your classes dir and access via
http://localhost/servlet/package.a
See if this works.
And can some one shed light on why this happens?


Pravin R Panicker<br />SCJP,SCWCD
Bhushan Jawle
Ranch Hand

Joined: Nov 22, 2001
Posts: 249
I had same problem with Tomcat, putting in package should solve it as mentioned above
Yuan Ye
Ranch Hand

Joined: Mar 05, 2003
Posts: 172
Hi, Pravin. Thanks for the suggestion. However for my case, seems it doesn't work even if I put the class in a package. Suggested by someone else, I solved the problem by modifying the web.xml. Looks like Tomcat4.1 doesn't support servlet class by calling the full qualified classname.
Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Please help
 
Similar Threads
HelloServlet not running ?
Servlets..
Deploy servlet
how can test my servlet in tomcat
please help