when a servlet sends request for first time it uses the
follwing methods
a)init
b)doget()
c)dopost()
d)service
Answer Posted / shaik baji
1)We can load the servlet class in two ways as follows:
a) We can load the servlet class while deploying our
applicaion on the server by using the "<load-on-startup>"
tag in web.xml
Ex: <load-on-startup>any positive integer </load-on-startup>
b) We can load the servlet class when the first request
came to it by the container.
2)Once the class is loaded the container will create the
instance of the servlet and initilize it with the
ServletConfig object by invoking "init(ServletConfig scObj)"
3)Then the container create a thread for the request and
execute the setvice() method.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
How we can run a jar file through command prompt in java?
Which sorting is best in java?
Which is best ide for java?
What is the function of character?
What does yield method of the thread class do?
How does class forname work in java?
What is the protected method modifier?
What is a stack class in java ?
What do you mean by light weight and heavy weight components?
If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?
How to change the priority of thread or how to set the priority of thread?
What is java in simple terms?
How to perform selection sort in java?
What is e java?
What is an escape character in java?