Loading
load on startup

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  How could you have two or more Servlets in your web application ?


Ans)

We can have any number of Servlets in any web application, Servlet  loading priority to be set as shown below

with " <load-on-startup>1</load-on-startup>"  ,  if "load-on-startup" is 1 for any given Servlet, that will be loaded

first .

 <servlet>
  <servlet-name>Init</servlet-name>
  <servlet-class>
            com.InitServlet
        </servlet-class>

  <init-param>
   <param-name>loggingLevel</param-name>
   <param-value>1</param-value>
  </init-param>
  <init-param>
   <param-name>propertiesFile</param-name>
   <param-value>/WEB-INF/properties/yourconfig.xml</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
 </servlet>
 <servlet>
  <servlet-name>DetailServlet</servlet-name>
  <servlet-class>
            com.PropertyDetailsServlet
        </servlet-class>
 </servlet>



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

load on startup


load on startup

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free