Servlets
Servlets
Only one object at the time of first request by servlet or web container.
1. Servlet is loaded
2. servlet is instantiated
3. servlet is initialized
4. service the request
5. servlet is destroyed
more details...
Method Description
Get Post
1) Limited amount of data can be sent because Large amount of data can be sent because
data is sent in header. data is sent in body.
2) Not Secured because data is exposed in Secured because data is not exposed in
URL bar. URL bar.
4) Idempotent Non-Idempotent
5) It is more efficient and used than Post It is less efficient and used
more details...
o RequestDispacher interface
o sendRedirect() method etc.
more details...
more details...
1. RequestDispatcher rd=request.getRequestDispatcher("/login.jsp");
2. rd.forward(request,response);
more details...
1) forward() sends the same 1) sendRedirect() method sends new request always
request to another resource. because it uses the URL bar of the browser.
2) forward() method works at 2) sendRedirect() method works at client side.
server side.
3) forward() method works within 3) sendRedirect() method works within and outside the
the server only. server.
more details...
more details...
18) How can we perform any action at the time of
deploying the project?
By the help of ServletContextListener interface.
more details...
more details...
more details...
more details...
more details...
To create war file from console, you can write following code.
Now all the files of current directory will be converted into abc.war file.
more details...
more details...
more details...
28) Which event is fired at the time of setting,
getting or removing attribute from application
scope?
ServletContextAttributeEvent.
more details...