what is the control flow in servlet when we send a request?
Answer Posted / dipak.cvrca
-->first request comes from client browser to server
(container)which takes the control to the web.xml file.
-->in xml file servlet file(.class) will be searched
according to the information about the url pattern given
in the address,then coresponding class file is loaded to
the container(loading) by the method
java.lang.class.forName().newInstance.
-->now container call the init(servletConfig) method to add
necessary headers in the servlet,such as Config,context
session,request and many more.
-->now control pass to the service()of the HttpServlet(if
you have extended this class) and the type of method
(get/post) is checked and accordingly the control will
pass to the implemented doGet() or doPost() of the your
class(by the dynamic method dispatch)
-->after service the container will call the destroy() of
Servlet class.
i hope this answer will satishfy you,thank
you,(Dipak ku. jenamani)
| Is This Answer Correct ? | 95 Yes | 7 No |
Post New Answer View All Answers
What is the difference between jsp and servlet life cycle?
How can a servlet be used to generate plain text instead of html?
Write a hello world program using servlets.
What exception should be thrown when servlet is not properly initialized?
What is a servlet-to-servlet communcation?
What is the difference between a generic servlet and http servlet?
Explain web application directory arrangement?
What are Servlets?
What is the difference between 2 types of servlets?
How is the get () method different from the post() method?
Explain load on start-up and its importance?
How is an application exception handling is done using a servlet?
Servlet is pure java object or not?
Describe the phases of servlet lifecycle?
What is meant by a web application