File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
 
 
subject: Please help