Forums Register Login

Servlet instance creation

+Pie Number of slices to send: Send
Hi, How Servlet container will create Servlet instance..I read the following ways in the net but not sure which one is right

1. Container use any Reflection API.
2. Container calls class.forName(classname).newInstance()
3. Container calls init() method
+Pie Number of slices to send: Send
The container can create an instance any way that it wants to -- the Specification doesn't mandate any particular way.

After the servlet instance is created, its init() life-cycle method will be called regardless of how the container has chosen to perform the instantiation. This is not a means by which instantiation happens, but something that occurs after instantiation.
Attractive, successful people love this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1014 times.
Similar Threads
Servlet Container
init() called at the same time
Servlet Life Cycle-Destroy method
How Servlet Container creates an instance of your Servlet
Why using init() method
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:44:34.