How servlets can be automatically reloaded?

Answer Posted / sandeep m

The servlet which we want to be loaded automatically on
application deployment or during container startup we need
to configure <load-on-startup>int</load-on-startup> tag for
the servlet. above tag will be in <servlet> tag body.
<load-on-startup> is optional tag. If provided Servlets
will be loaded on application or container startup in the
order of the int value of tag.
If <load-on-startup> tag is not provided servlets are
loaded when first request is received after container
startup or first request after application deployment.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you push data from an Applet to a Servlet?

858


What are the types of servlet?

920


What is the web server used for running the Servlets?

778


What mechanisms are used by a Servlet Container to maintain session information?

910


What is the workflow of a servlet?

932


Can we use threads in Servlets?

865


What is the directory structure of web application?

745


What is java servlet session?

743


Why do we need servlet filter?

813


Can you call a jsp from the servlet?

765


Which event is fired at the time of setting, getting or removing attribute from application scope?

891


How the typical servlet code look like ?

896


What are the differences between forward() method and sendredirect() methods?

788


What do you understand by mime type?

805


Describe the phases of servlet lifecycle?

837