how to run servelets in java ..I think there is no error in my following code...In java compiler its tellin that package does not exists.
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloServelet extends GenericServelet
{
public void service(ServletRequest request,ServletResponse response)throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter pw=response.getWriter();
pw.println("<b> Hello");
pw.close();
}
}
While compling its showing following errors:
C:\Program Files\Java\jdk1.5.0\bin>javac HelloServelet.java
HelloServelet.java:4: package javax.servlet does not exist
import javax.servlet.*;
^
HelloServelet.java:5: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
HelloServelet.java:7: cannot find symbol
symbol: class GenericServelet
public class HelloServelet extends GenericServelet
^
HelloServelet.java:9: cannot find symbol
symbol : class ServletRequest
location: class HelloServelet
public void service(ServletRequest request,ServletResponse response)throws Ser
vletException, IOException
^
HelloServelet.java:9: cannot find symbol
symbol : class ServletResponse
location: class HelloServelet
public void service(ServletRequest request,ServletResponse response)throws Ser
vletException, IOException
^
HelloServelet.java:9: cannot find symbol
symbol : class ServletException
location: class HelloServelet
public void service(ServletRequest request,ServletResponse response)throws Ser
vletException, IOException
^
6 errors