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


Please Help Members By Posting Answers For Below Questions

What is the full form of jpeg?

511


What is mnemonic code?

535


What is a class object?

496


What is the difference between the final method and abstract method?

536


Can we declare an interface as final?

568






What is string value?

632


What is the use of parseint in java?

532


Why javac is not recognized?

515


What sorting algorithm does javascript use?

525


What are access specifiers available in java?

573


Can one thread block the other thread?

599


Write a code to show a static variable?

609


What is the use of arraylist class in java?

548


What happens if we don’t define serial version uid?

563


Why should we use singleton pattern instead of static class?

457