• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help

 
Yuan Ye
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Bhushan Jawle
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had same problem with Tomcat, putting in package should solve it as mentioned above
 
Yuan Ye
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic