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
Differentiate between the print writer and servlet output stream?
How to get ip address in jsp login page and how to validate like 127.1.0.1 all should not be greater than 255
What is called servlet container?
What is servlet and list its types?
How do you invoke a Servlet? What is the difference between doPost method and doGet method?
What are the different methods involved in generic servlet?
What do you mean by chaining in servlet?
Why do we use sendredirect() method?
What is http servlet?
Is java servlet still used?
Explain the working of service() method of a servlet.
I have a requirement Here we have a ResultSet object that will contain 50 records i need to print those recors in to a webpage(i.e; view according to MVC architectures that mybe servlet or jsp) . Here i need to print the records 10 per page that is 1 to 10 in page one and 11 to 20 in page two like remaining will be appeared in other pages we need to display those page numbers whenever we click on that page number we will go to that page and display 10 records like we will display 5 pages it is like this << 1 2 3 4 5 next >>
If servlet receives multiple requests, how many objects will it create?
Explain how to improve Servlet Performance?
Which event is fired at the time of project deployment and undeployment?