|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface ServletRegistration.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. |
void |
setMultipartConfig(MultipartConfigElement multipartConfig)
Sets the MultipartConfigElement to be applied to the
mappings defined for this ServletRegistration . |
void |
setRunAsRole(java.lang.String roleName)
Sets the name of the runAs role for this
ServletRegistration . |
java.util.Set<java.lang.String> |
setServletSecurity(ServletSecurityElement constraint)
Sets the ServletSecurityElement to be applied to the
mappings defined for this ServletRegistration . |
Methods inherited from interface javax.servlet.ServletRegistration |
---|
addMapping, getMappings, getRunAsRole |
Methods inherited from interface javax.servlet.Registration.Dynamic |
---|
setAsyncSupported |
Methods inherited from interface javax.servlet.Registration |
---|
getClassName, getInitParameter, getInitParameters, getName, setInitParameter, setInitParameters |
Method Detail |
---|
void setLoadOnStartup(int loadOnStartup)
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.
loadOnStartup
- the initialization priority of the Servlet
IllegalStateException
- if the ServletContext from which
this ServletRegistration was obtained has already been initializedjava.util.Set<java.lang.String> setServletSecurity(ServletSecurityElement constraint)
ServletSecurityElement
to be applied to the
mappings defined for this ServletRegistration
.
This method applies to all mappings added to this
ServletRegistration
up until the point that the
ServletContext
from which it was obtained has been
initialized.
If a URL pattern of this ServletRegistration is an exact target
of a security-constraint
that was established via
the portable deployment descriptor, then this method does not
change the security-constraint
for that pattern,
and the pattern will be included in the return value.
If a URL pattern of this ServletRegistration is an exact
target of a security constraint that was established via the
ServletSecurity
annotation
or a previous call to this method, then this method replaces
the security constraint for that pattern.
If a URL pattern of this ServletRegistration is neither the
exact target of a security constraint that was established via
the ServletSecurity
annotation
or a previous call to this method, nor the exact target of a
security-constraint
in the portable deployment
descriptor, then this method establishes the security constraint
for that pattern from the argument
ServletSecurityElement
.
constraint
- the ServletSecurityElement
to be applied
to the patterns mapped to this ServletRegistration
security-constraint
that was
established via the portable deployment descriptor. This method
has no effect on the patterns included in the returned set
IllegalArgumentException
- if constraint is null
IllegalStateException
- if the ServletContext
from
which this ServletRegistration
was obtained has
already been initializedvoid setMultipartConfig(MultipartConfigElement multipartConfig)
MultipartConfigElement
to be applied to the
mappings defined for this ServletRegistration
. If this
method is called multiple times, each successive call overrides the
effects of the former.
multipartConfig
- the MultipartConfigElement
to be
applied to the patterns mapped to the registration
IllegalArgumentException
- if multipartConfig is
null
IllegalStateException
- if the ServletContext
from
which this ServletRegistration was obtained has already been
initializedvoid setRunAsRole(java.lang.String roleName)
runAs
role for this
ServletRegistration
.
roleName
- the name of the runAs
role
IllegalArgumentException
- if roleName is null
IllegalStateException
- if the ServletContext
from
which this ServletRegistration was obtained has already been
initialized
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.
Generated on 10-February-2011 12:41