can't compile simple servlet?


Web tier: servlets, JSP, Web frameworks: can't compile simple servlet?

  1. can't compile simple servlet? (2 messages)


    I am compiling one simple servlet( where certain packages are imported but error messages like
    package javax.servlet does not exist,
    package javax.servlet.http does not exist,
    cannot resolve symbol (symbol : class HttpServlet),etc. is displayed.

    Here is the code:

    import java.text.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;

    public class HelloWorldExample extends HttpServlet {

        public void doGet(HttpServletRequest request,
                          HttpServletResponse response)
            throws IOException, ServletException
             ................. //other code

    What's wrong?
  2. can't compile simple servlet?[ Go to top ]

    You don't have Servlet.jar in your classpath

  3. can't compile simple servlet?[ Go to top ]

    Thanks it worked but when tomcat get installed, it should automatically add servlet.jar to classpath.