-
- All Superinterfaces:
- Registration, Registration.Dynamic, ServletRegistration
- Enclosing interface:
- ServletRegistration
public static interface ServletRegistration.Dynamic extends ServletRegistration, Registration.Dynamic
Interface through which aServlet
registered via one of the addServlet methods onServletContext
may be further configured.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface javax.servlet.ServletRegistration
ServletRegistration.Dynamic
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description void
setLoadOnStartup(int loadOnStartup)
Sets theloadOnStartup
priority on the Servlet represented by this dynamic ServletRegistration.void
setMultipartConfig(MultipartConfigElement multipartConfig)
Sets theMultipartConfigElement
to be applied to the mappings defined for thisServletRegistration
.void
setRunAsRole(String roleName)
Sets the name of therunAs
role for thisServletRegistration
.Set<String>
setServletSecurity(ServletSecurityElement constraint)
Sets theServletSecurityElement
to be applied to the mappings defined for thisServletRegistration
.-
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
-
setLoadOnStartup
void setLoadOnStartup(int loadOnStartup)
Sets theloadOnStartup
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(javax.servlet.ServletContextEvent)
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 ServletRegistration was obtained has already been initialized
-
setServletSecurity
Set<String> setServletSecurity(ServletSecurityElement constraint)
Sets theServletSecurityElement
to be applied to the mappings defined for thisServletRegistration
.This method applies to all mappings added to this
ServletRegistration
up until the point that theServletContext
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 thesecurity-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 asecurity-constraint
in the portable deployment descriptor, then this method establishes the security constraint for that pattern from the argumentServletSecurityElement
.- Parameters:
constraint
- theServletSecurityElement
to be applied to the patterns mapped to this ServletRegistration- Returns:
- the (possibly empty) Set of URL patterns that were already
the exact target of a
security-constraint
that was established via the portable deployment descriptor. This method has no effect on the patterns included in the returned set - Throws:
IllegalArgumentException
- if constraint is nullIllegalStateException
- if theServletContext
from which thisServletRegistration
was obtained has already been initialized
-
setMultipartConfig
void setMultipartConfig(MultipartConfigElement multipartConfig)
Sets theMultipartConfigElement
to be applied to the mappings defined for thisServletRegistration
. If this method is called multiple times, each successive call overrides the effects of the former.- Parameters:
multipartConfig
- theMultipartConfigElement
to be applied to the patterns mapped to the registration- Throws:
IllegalArgumentException
- if multipartConfig is nullIllegalStateException
- if theServletContext
from which this ServletRegistration was obtained has already been initialized
-
setRunAsRole
void setRunAsRole(String roleName)
Sets the name of therunAs
role for thisServletRegistration
.- Parameters:
roleName
- the name of therunAs
role- Throws:
IllegalArgumentException
- if roleName is nullIllegalStateException
- if theServletContext
from which this ServletRegistration was obtained has already been initialized
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/servlet/ServletRegistration.Dynamic.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Manuel PHP : https://docs.oracle.com,
ServletRegistration.Dynamic (Java(TM) EE 7 Specification APIs)
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.