how a servlet is instantiated, whether the container calls
init() or by calling any other method? please somebody reply..
Answer Posted / suraj kumar
The servlet is controlled by the container in which the servlet has been deployed. When a request is made to a servlet, its mapping is searched in web.xml. If mapping found then the container performs the following steps.
a.If an instance of the servlet does not exist, the Web container loads the servlet class.
b.Creates an instance of the servlet class.
c.Initializes the servlet instance by calling the init method
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
What are the uses of servlet and what is servlet chaining?
What do you mean by singlethreadmodel interface?
What’s the difference between forward() and sendredirect() methods?
What are the important functions of filters?
What do you mean by default initialization in java servlet?
What is the use of servlet wrapper classes?
What is the difference between CGI and Servlet?
What is the effective way to make sure all the servlets are accessible only when user has a valid session?
What is new in ServletRequest interface ? (Servlet 2.4)
Whether we can get deadlock situation in servlets?
Explain the servlet filter.
What do you mean by the servlet chaining?
How a servlet is unloaded?
Write a program to show the functionality of doget and dopost method?
How do you create a cookie using servlet?