Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat won't run my servlet

 
Michael Schneider
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm setting up tomcat for the first time, and I've gotten sample HTML and JSP files to load by placing them in the tomcat_home\webapps\ROOT directory and going to http://localhost/Hello.html and Hello.jsp.
However, when I create a classes subdirectory off of tomcat_home\webapps\ROOT\WEB-INF\ and place a servlet class file there, going to http://localhost/serlvet/HelloServlet doesn't work.
The servlet compiles fine, so my CLASSPATH is working, but nothing happens when I try to load that page.
Any ideas as to what might cause this?
Thanks,
Michael
 
CaryB
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like things have been done right so far. If it's small, perhaps you could post your code? Maybe do a simple Hello World servlet to see if that works.
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Did you set up your Servlet in web.xml?
/Rene
 
kablan jean
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check yo see if you hava a servel jar file in your jdk. I remember having the same problem. Find a sevlet.jar file wherever you can find it and put it in jdk... mine is C:\jdk1.3.1\jre\lib\ext\servlet.jar. Don't also forget to update your classpath.
good luck!
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kablan, it would not even compile if servlet.jar was not in the right place.
Try specifying the port number as in... http://localhost:8080/serlvet/HelloServlet
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic