DRAFT

javax.servlet
Interface ServletRegistration.Dynamic

All Superinterfaces:
Registration, Registration.Dynamic, ServletRegistration
Enclosing interface:
ServletRegistration

public static interface ServletRegistration.Dynamic
extends ServletRegistration, Registration.Dynamic

Interface through which a Servlet registered via one of the addServlet methods on ServletContext may be further configured.


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.servlet.ServletRegistration
ServletRegistration.Dynamic
 
Method Summary
 void setLoadOnStartup(int loadOnStartup)
          Sets the loadOnStartup priority on the Servlet represented by this dynamic ServletRegistration.
 
Methods inherited from interface javax.servlet.ServletRegistration
addMapping, getMappings
 
Methods inherited from interface javax.servlet.Registration.Dynamic
setAsyncSupported, setDescription
 
Methods inherited from interface javax.servlet.Registration
getClassName, getInitParameter, getInitParameters, getName, setInitParameter, setInitParameters
 

Method Detail

setLoadOnStartup

void setLoadOnStartup(int loadOnStartup)
Sets the loadOnStartup priority on the Servlet represented by this dynamic ServletRegistration.

A loadOnStartup value of greater than or equal to zero indicates to the container the initialization priority of the Servlet. In this case, the container must instantiate and initialize the Servlet during the initialization phase of the ServletContext, that is, after it has invoked all of the ServletContextListener objects configured for the ServletContext at their ServletContextListener#contextInitialized method.

If loadOnStartup is a negative integer, the container is free to instantiate and initialize the Servlet lazily.

The default value for loadOnStartup is -1.

A call to this method overrides any previous setting.

Parameters:
loadOnStartup - the initialization priority of the Servlet
Throws:
IllegalStateException - if the ServletContext from which this dynamic ServletRegistration was obtained has already been initialized

DRAFT

Submit a bug or feature

Copyright © 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.