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


Please Help Members By Posting Answers For Below Questions

How is an application exception handling is done using a servlet?

539


What is a servlet engine?

544


What is session tracking?

698


Why do we use sendredirect() method?

550


What is the process to implement doget and dopost methods?

546






What are some disadvantages of storing session state in cookies?

588


How can we create deadlock situation in servlet?

848


hi actully i hav form columns with origin and destination names .as like as i need to create one more column with name amount. my requirement is when i select origin and destination columns automatically i need to get amount from database.how can i. please tel me with relative code

2282


What is Servlets and explain the advantages of Servlet life cycle?

583


What are different ways for authentication of servlet?

526


What do you mean by interservlet communication?

586


How servlet is created?

546


I Have A Plan to develop a Project in Struts,I want the template of struts project with Hibernate.Canany body provide me the required information?

2234


What is the use of attribute in servlets?

542


What are the types of Session Tracking ?

648