| Author |
load on start-up
|
Srinivasa Kadiyala
Ranch Hand
Joined: Jun 10, 2004
Posts: 237
|
|
Can I use more than one <load-on-startup> tag in a web.xml? Ofcourse for diff servelts mentioned in web.xml Example: <servlet> <servlet-name>Log4JInit</servlet-name> <servlet-class>com.me.pictures.logging.LogInitServlet</servlet-class> <init-param> <param-name>log4j-init-file</param-name> <param-value>/WEB-INF/classes/resources/log4j.properties</param-alue> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>debug</servlet-name> <servlet-class>com.me.pictures.debug.DebugServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet>
|
Srini
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Yes, but you wouldn't want them both to be number 1. That number determines the order in which the servlets load.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Srinivasa Kadiyala
Ranch Hand
Joined: Jun 10, 2004
Posts: 237
|
|
Thanks Ben....
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56153
|
|
|
Although you can legally repeat the same number if the order of load doesn't matter. For example if A and B need to load before C, but the order of A and B is moot, both A and B can be 1, and C can be 2.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Srinivasa Kadiyala
Ranch Hand
Joined: Jun 10, 2004
Posts: 237
|
|
|
Thanks Bear. Ben and you helped me to understand this funda
|
 |
 |
|
|
subject: load on start-up
|
|
|