Category: Servlet

Session tracking methods in Servlet? 0

Session tracking methods in Servlet?

What is Session? What is Session Management? Why Use Session Management? Different ways to maintain Session. Hidden form field URL rewriting Cookies Servlet session API [ HttpSession ] Session Management Examples What is Session?...

Difference between forward and Redirect 0

Difference between forward and Redirect

forward Control can be forward to resources available within the server from where the call is made. This transfer of control is done by the container internally and browser / client is not involved....

Explain the directory structure of a web application. 0

Explain the directory structure of a web application.

The directory structure of a web application consists of two parts. A private directory called WEB-INF A public resource directory which contains public resource folder. WEB-INF folder consists of 1. web.xml 2. classes directory...

What are the common mechanisms used for session tracking? 0

What are the common mechanisms used for session tracking?

the common mechanisms used for session tracking Hidden Form Field, Cookies, SSL sessions (HttpSession) , URL- rewriting,

What is the difference between the getRequestDispatcher(String path) method of javax.servlet.ServletRequest interface and javax.servlet.ServletContext interface? 0

What is the difference between the getRequestDispatcher(String path) method of javax.servlet.ServletRequest interface and javax.servlet.ServletContext interface?

The getRequestDispatcher(String path) method of javax.servlet.ServletRequest interface accepts parameter the path to the resource to be included or forwarded to, which can be relative to the request of the calling servlet. If the path...

Explain the life cycle methods of a Servlet. 0

Explain the life cycle methods of a Servlet.

The javax.servlet.Servlet interface defines the three methods known as life-cycle method. public void init(ServletConfig config) throws ServletException public void service( ServletRequest req, ServletResponse res) throws ServletException, IOException public void destroy() First the servlet is...

What is the difference between ServletContext and ServletConfig? 0

What is the difference between ServletContext and ServletConfig?

ServletContext: Defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file....

What is the difference between HttpServlet and GenericServlet? 0

What is the difference between HttpServlet and GenericServlet?

A GenericServlet has a service() method aimed to handle requests. HttpServlet extends GenericServlet and adds support for doGet(), doPost(), doHead() methods (HTTP 1.0) plus doPut(), doOptions(), doDelete(), doTrace() methods (HTTP 1.1). Both these classes...

Difference between forward and Redirect 0

Difference between forward and Redirect

forward Control can be forward to resources available within the server from where the call is made. This transfer of control is done by the container internally and browser / client is not involved....

What is the difference between Difference between doGet() and doPost()? 0

What is the difference between Difference between doGet() and doPost()?

A doGet() method is limited with 2k of data to be sent, and doPost() method doesn’t have this limitation. A request string for doGet() looks like the following: http://www.javaskool.com/servlet123?p1=v1&p2=v2&…&pN=vN doPost() method call doesn’t need...