I like to know is there any other way servlet instance get created. One way is when client makes a first request to the servlet.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can specify servlet creation/running on startup of the container.
specifies a startup order. The above specifies that
TestServletwill start on container startup, and be the first (hence1).I often prefer servlets starting during container startup. It allows them to perform any time-consuming initialisation prior to client interaction.
EDIT: As Skaffman pointed out below,
0means start on first request.