File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes error: package javax.servlet does not exist Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "error: package javax.servlet does not exist" Watch "error: package javax.servlet does not exist" New topic

error: package javax.servlet does not exist

david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
I am trying to write my first servlet (I have jsp working) Note: I have not downloaded ant???
when I compile it tells me that it cant find javax.servlet. Any ideas. thanks
here is my code
import javax.servlet.*;
import javax.servlet.http.*;

class HelloClientServlet extends HttpServlet
protected void doGet(HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException
PrintWriter out = res.getWriter();
out.println("<HTML><HEAD><TITLE>Hello Client!</TITLE>"+
"</HEAD><BODY>Hello Client!</BODY></HTML>");
public String getServletInfo()
return "HelloClientServlet 1.0 by Stefan Zeiger";
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

Be sure that servlet.jar is in your classpath.

[Asking smart questions] [About Bear] [Books by Bear]
wood burning stoves
subject: error: package javax.servlet does not exist
It's not a secret anymore!