Results 1 to 2 of 2
  1. #1
    rida is offline Member
    Join Date
    Jul 2010
    Posts
    1
    Rep Power
    0

    Default servlet not compiled

    my some servlet compiled but some servlet not compiled like this one is not compile : please help me why ??

    import java.io.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class MyServlet2 extends HttpServlet {
    // attribute used to store init-parameter value
    String fileName;
    // overriding init() method
    public void init(ServletConfig config) throws ServletException{
    super.init(config);
    // reading init-parameter "logfilename" stored in web.xml
    fileName = config.getInitParameter("logfilename");
    }
    /*
    Both doGet() & doPost() methods are override over here.
    processRequest() is called from both these methods. This makes
    possible for a servlet to handle both POST and GET requests
    identically.
    */
    // Handles the HTTP GET request type
    protected void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException
    {
    processRequest(request, response);
    }
    // Handles the HTTP POST request type
    protected void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException
    {
    processRequest(request, response);
    }
    out.println("</html>");
    // closing PrintWriter stream
    out.close();
    }
    // This method only calls processRequest()
    protected void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    }
    // This method only calls processRequest()
    protected void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    }

    } // end MyServlet

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,883
    Rep Power
    25

    Default

    If you get errors, please copy and paste the full text of the error message here.

Similar Threads

  1. Where is it situated compiled classes?
    By artemff in forum New To Java
    Replies: 1
    Last Post: 12-27-2009, 03:43 AM
  2. How to import a package before it is compiled
    By gradStudent in forum Advanced Java
    Replies: 1
    Last Post: 08-11-2009, 01:17 AM
  3. JNLP - Swing application compiled in jdk1.5 not working in jdk1.6
    By mahendra.athneria in forum AWT / Swing
    Replies: 4
    Last Post: 01-20-2009, 09:27 PM
  4. Replies: 3
    Last Post: 12-12-2008, 03:44 PM
  5. Using compiled Classes
    By Mindhunter74 in forum NetBeans
    Replies: 17
    Last Post: 12-02-2008, 10:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •