I want to know why set this value to 1.I read the api,it means Sets the loadOnStartup priority on the Servlet represented by this dynamic ServletRegistration.Why is 1?
I read a piece of code :
public void onStartup(ServletContext servletContext)
throws ServletException {
// TODO Auto-generated method stub
AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
ctx.register(WebAppConfig.class);
servletContext.addListener(new ContextLoaderListener(ctx));
ctx.setServletContext(servletContext);
Dynamic servlet = servletContext.addServlet("dispatcher", new DispatcherServlet(ctx));
servlet.addMapping("/");
servlet.setLoadOnStartup(1);
}