View Single Post
  #1 (permalink)  
Old 05-20-2008, 10:36 AM
srinivaspuvvala srinivaspuvvala is offline
Member
 
Join Date: May 2008
Posts: 7
srinivaspuvvala is on a distinguished road
help me to set classpath
I am new to java .
i have tomcat 5.5.

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;


public class SecondEx extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>Hello World!</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Hello World!</h1>");
out.println("</body>");
out.println("</html>");
}

when i am trying to excute this program i got errors like


package javax.servlet does not exist

package javax.servlet.http does not exist

cannot find symbol class HttpServletRequest
cannot find symbol class HttpServletResponse
cannot find symbol class ServletException

could any body help me to fix this errors.

i have tried classpaths like

CLASSPATH :C:\Program Files\Apache Software Foundation\Tomcat 5.5\server\lib

and

C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib

but it did n0t work.
Reply With Quote
Sponsored Links