• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet compilation error  RSS feed

 
Pawan Arora
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really don't understand why I'm not able to compile my servlet class. I've set the classpath as: C:\Tomcat 5.5\common\lib\servlet-api.jar and path variable as:C:\Program Files\Java\jdk1.6.0_12\bin. But I'm still getting compile time error. Could anyone please tell me, what's wrong I'm doing.

Thanks in advance.
 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would help if you showed us the error(s).
 
Pawan Arora
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ch1Servlet.java:1: package javax.servlet does not exist
import javax.servlet.*;
^

Ch1Servlet.java:2: package javax.servlet.http does not exist
import javax.servlet.http.*;
^

Ch1Servlet.java:5: cannot find symbol
symbol: class HttpServlet
public class Ch1Servlet extends HttpServlet
^


Ch1Servlet.java:8: cannot find symbol
symbol : class HttpServletRequest
location: class Ch1Servlet
public void doGet(HttpServletRequest request, HttpServletResponse respone) throws IOException


Ch1Servlet.java:8: cannot find symbol
symbol : class HttpServletRequest
location: class Ch1Servlet
public void doGet(HttpServletRequest request, HttpServletResponse respone) throws IOException

^

Ch1Servlet.java:11: cannot find symbol
symbol : variable response
location : class Ch1Servlet
PrintWriter out=response.getWriter();

6 errors

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!