public interface ServletRegistration extends Registration
Servlet
may be further configured.Modifier and Type | Interface and Description |
---|---|
static interface |
ServletRegistration.Dynamic
Interface through which a
Servlet registered via one of the
addServlet methods on ServletContext may be further
configured. |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
addMapping(java.lang.String... urlPatterns)
Adds a servlet mapping with the given URL patterns for the Servlet
represented by this ServletRegistration.
|
java.util.Collection<java.lang.String> |
getMappings()
Gets the currently available mappings of the
Servlet represented by this
ServletRegistration . |
java.lang.String |
getRunAsRole()
Gets the name of the runAs role of the Servlet represented by this
ServletRegistration . |
getClassName, getInitParameter, getInitParameters, getName, setInitParameter, setInitParameters
java.util.Set<java.lang.String> addMapping(java.lang.String... urlPatterns)
If any of the specified URL patterns are already mapped to a different Servlet, no updates will be performed.
If this method is called multiple times, each successive call adds to the effects of the former.
The returned set is not backed by the ServletRegistration
object, so changes in the returned set are not reflected in the
ServletRegistration
object, and vice-versa.
urlPatterns
- the URL patterns of the servlet mappingjava.lang.IllegalArgumentException
- if urlPatterns is null
or emptyjava.lang.IllegalStateException
- if the ServletContext from which this
ServletRegistration was obtained has already been initializedjava.util.Collection<java.lang.String> getMappings()
ServletRegistration
.
If permitted, any changes to the returned Collection
must not
affect this ServletRegistration
.
Collection
of the currently
available mappings of the Servlet represented by this
ServletRegistration
java.lang.String getRunAsRole()
ServletRegistration
.