- All Superinterfaces:
- All Known Subinterfaces:
public interface ServletRegistration extends Registration
Interface through which a Servlet may be further configured.
- Servlet 3.0
Nested Class SummaryModifier and TypeInterfaceDescription
static interfaceInterface through which a Servlet registered via one of the addServlet methods on ServletContext may be further configured.
Method SummaryModifier and TypeMethodDescriptionAdds a servlet mapping with the given URL patterns for the Servlet represented by this ServletRegistration.Gets the currently available mappings of the Servlet represented by this ServletRegistration.Obtain the name of the user / group under which the Servlet has been configured to run.
addMappingAdds a servlet mapping with the given URL patterns for the Servlet represented by this ServletRegistration. 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 that this Servlet should be mapped to
- the (possibly empty) Set of URL patterns that are already mapped to a different Servlet
IllegalArgumentException- if urlPattern is null or empty
IllegalStateException- if the associated ServletContext has already been initialised
getMappingsGets the currently available mappings of the Servlet represented by this ServletRegistration. If permitted, any changes to the returned Collection must not affect this ServletRegistration.
- a (possibly empty) Collection of the currently available mappings of the Servlet represented by this ServletRegistration
getRunAsRoleString getRunAsRole()Obtain the name of the user / group under which the Servlet has been configured to run.
- the name of the user / group or
nullif none has been specified