Type: Posts; User: Chicharito

Search: Search took 0.94 seconds.

  1. Replies

    What is a session?

    A session can be defined as a collection of HTTP requests, over a period of time, between a client and a Web Server. When a session is created the lifetime of the session is also set. The session...
  2. Which are the methods of the HttpSession interface which help a servlet to manage session lifecycle?

    1. invalidate()
    2. setMaxInactiveInterval(int interval)
    3. isNew()
    4. getCreationTime()
    5. getLastAccessedTime()
  3. Replies

    How cookies are used to track a session?

    Using cookies is the simplest and easiest way to track a session. A unique session id (stored in the form of cookie) is sent by the server to the client as a part of the response and the same session...
  4. Which are the session tracking techniques?

    1. Cookie
    2. Hidden Form Fields
    3. URL Rewriting
    4. SSL (Secure Socket Layer) sessions
  5. Cookie belongs to class of which package?

  6. How is the GET method different from the POST method?

    In GET method, all data submitted with HTML form is attached with URL. This method is faster and easier to use than the POST method but not as secure and the upper limit of URL length limits the...
  7. What does init() method of a servlet do?

    The init() method of the HttpServlet class is called before a servlet handles the first request and is used to initialize the servlet. The init() method also saves the ServletConfig object by using...
  8. What is the difference between the getRequestDispatcher() methods of ServletRequest and ServletContext interfaces?

    Both getRequestDispatcher() methods take a String parameter which is a path to a location where a user's request would be forwarded. The getRequestDispatcher() method of the ServletRequest interface...
  9. What is the difference between ServletContext and ServletConfig objects?

    A ServletContext object is used to communicate with a Servlet container while ServletConfig which is a Servlet Configuration object is passed to the servlet by a container when the servlet is...
  10. Replies

    What is a servlet?

    A servlet is a simple Java class working on request-response model. Various interfaces and classes to handle common HTTP-specific services are defined in the Java Servlet API. Each servlet implements...
  11. Replies

    import javax.servlet.*;
    import javax.servlet.http.*;
    public class FirstServlet extends HttpServlet{
    public void init(ServletConfig config) throws ServletException{...
Results 1 to 11 of 11