• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to run a servletrunner

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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/...............
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic