when a servlet sends request for first time it uses the
follwing methods
a)init
b)doget()
c)dopost()
d)service
Answers were Sorted based on User's Feedback
Answer / sri
when servlet gets first request, webcontainer loads the class and creates the object for it.
2)Constructor executes
3)webcontainer creates ServletConfig obj for servlet obj
4)init() method executes
5)service() method executes.
| Is This Answer Correct ? | 11 Yes | 0 No |
Answer / 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 |
Answer / sowmya
A servlet can receive a request or forward the request to
another component in an application.
When a servlet receives a request, if it is already
initialized, then the service() method is called. If not
then its constructor is called and then its init() method.
| Is This Answer Correct ? | 4 Yes | 3 No |
1) Find the Merge point of two linked lists. 2) Swap two bits of integer. 3) Reverse individual words of the sentence. 4) Reverse string without using temp string.
what is ABSTRACTION and what are using in real time project?
What is the base class of all exception classes?
What does @override mean?
Why we go for collections in java?
What is the use of Getters and Setters method ?
what is meant by serialization?
what is features of jdk 1.5?
2 Answers Accenture, Satyam, TCS,
program to find 25 square = 625 here the 625 of last two digits is equal to 25, i don't know excatly what this type of number is called
What is the exception hierarchy in java?
Can you declare the main method as final?
Why are constructors used?