• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compiling the servlet, please help

 
claudio manuel
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have downloaded C:\j2sdkee1.3.1 and C:\j2sdk1.4.2_06 and C:\Program Files\Apache Tomcat 4.0.

All the simple java programs works fine. But with servlets I have the following errors:
It gives me a compiler error as follows:

C:\JavaAssg\SimpleServlet.java:1: cannot resolve symbol
symbol : class HttpServlet
location: class SimpleServlet
public class SimpleServlet extends HttpServlet{

what else should be in the path?
it seems to me that it is unable to find the class HttpServlet?
do I have to create \webpages\web-inf subfolders?

Can somebody please help me??
 
vishwa venkat
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set classpath to servlet class files..

If ur using tomcat4.x
set classpath=%TOMCAT_HOME%\common\lib\servlet.jar;.;

using tomcat5.x
set classpath=%TOMCAT_HOME%\common\lib\servlet-api.jar;.;
 
Al Petersen
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And don't forget to import javax.servlet.http.HttpServlet in your class!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic