• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to run a servletrunner

 
poppey
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am folowing the web sites aboutservlet runner.but i don't follow.........
i wrote a simple program
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.println("Hello World");
}
}
and it gives the following error
import javax.servlet.http.*;
^
HelloWorldServlet.java:4: cannot resolve symbol
symbol : class HttpServlet
location: class HelloWorld
public class HelloWorld extends HttpServlet {
^
HelloWorldServlet.java:5: cannot resolve symbol
symbol : class HttpServletRequest
location: class HelloWorld
public void doGet(HttpServletRequest request,
^
HelloWorldServlet.java:6: cannot resolve symbol
symbol : class HttpServletResponse
location: class HelloWorld
HttpServletResponse response)
^
HelloWorldServlet.java:7: cannot resolve symbol
symbol : class ServletException
location: class HelloWorld
throws ServletException, IOException {
^
7 errors
what might be the cause.I compiled on java\bin where i compile my other programs.
thanks.........
please help me/...............
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class library for servlets is NOT part of the normal distribution SDK. You need to get a copy of the servlet.jar file - it is part of the Tomcat distribution from jakarta.apache.org
I suggest NOT using a servlet runner from an older distribution of the JSWDK, Sun turned all development over to the Apache organization quite a while ago.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic