Forums Register Login

who calls service method ?

+Pie Number of slices to send: Send
hi

i have got bunch of questions about servlet and life cycle.

Who calls service method & which class implements the service method ?


and if i deploy one web application today and tomorrow i undeploy it. in 1 day if i get 100 request.

how many times init() will be called ?
how many times service() method will be called ?
and how many times destroy() will be called ?

Thanks & Regards,
+Pie Number of slices to send: Send
A good place to start would be the servlet spec.
The section on the servlet life cycle is clear and well written.
You can find a link to this document in my signature.

Anyway.
The container calls the service method whenever a request comes in.
Init and destry will most likely be called once. (containers are free to take servlets out of commission to save resources). Each time it is taken out of service, the destroy method is called. Each time it it put into service, the init method will be called.
[ March 26, 2008: Message edited by: Ben Souther ]
+Pie Number of slices to send: Send
When i was posting the question i was knowing your answer.. "Servlet Spec"

Thanks... Will refer the servlet spec for "who calls service method "
+Pie Number of slices to send: Send
 

Originally posted by Ben Souther:
The container calls the service method whenever a request comes in.

 
This is my favorite tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1766 times.
Similar Threads
How that I call in java a service in the NT?
finalize()
Servlet's constructor
Which the method of call of a service in the NT?
how many times is _jspService called?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:18:29.