Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Java Programming Code Examples

Java > Servlets Code Examples

Load servlet at startup

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Load servlet at startup package com.ack.web.servlet; import javax.servlet.http.HttpServlet; /** * <servlet> <servlet-name>earlyriser</servlet-name> <servlet-class>com.ack.web.servlet.LoadServletAtStartup</servlet-class> <load-on-startup>7</load-on-startup> </servlet> This servlet has a load-at-startup priority of 7, meaning any servlet with a load priority lower than 7 will be loaded before this one, and those greater than 7 after. if a load-at-startup priority is not specified, for example <load-on-startup/>, the servlet engine chooses when */ public class LoadServletAtStartup extends HttpServlet { public void init() { System.out.println( getServletName() + ": initialised" ); } }