-
- All Known Subinterfaces:
- FilterRegistration, FilterRegistration.Dynamic, Registration.Dynamic, ServletRegistration, ServletRegistration.Dynamic
public interface Registration
Interface through which aServlet
orFilter
may be further configured.A Registration object whose
getClassName()
method returns null is considered preliminary. Servlets and Filters whose implementation class is container implementation specific may be declared without any servlet-class or filter-class elements, respectively, and will be represented as preliminary Registration objects. Preliminary registrations must be completed by calling one of the addServlet or addFilter methods onServletContext
, and passing in the Servlet or Filter name (obtained viagetName()
) along with the supporting Servlet or Filter implementation class name, Class object, or instance, respectively. In most cases, preliminary registrations will be completed by an appropriate, container-providedServletContainerInitializer
.- Since:
- Servlet 3.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface and Description static interface
Registration.Dynamic
Interface through which aServlet
orFilter
registered via one of the addServlet or addFilter methods, respectively, onServletContext
may be further configured.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description String
getClassName()
Gets the fully qualified class name of the Servlet or Filter that is represented by this Registration.String
getInitParameter(String name)
Gets the value of the initialization parameter with the given name that will be used to initialize the Servlet or Filter represented by this Registration object.Map<String,String>
getInitParameters()
Gets an immutable (and possibly empty) Map containing the currently available initialization parameters that will be used to initialize the Servlet or Filter represented by this Registration object.String
getName()
Gets the name of the Servlet or Filter that is represented by this Registration.boolean
setInitParameter(String name, String value)
Sets the initialization parameter with the given name and value on the Servlet or Filter that is represented by this Registration.Set<String>
setInitParameters(Map<String,String> initParameters)
Sets the given initialization parameters on the Servlet or Filter that is represented by this Registration.
-
-
-
Method Detail
-
getName
String getName()
Gets the name of the Servlet or Filter that is represented by this Registration.- Returns:
- the name of the Servlet or Filter that is represented by this Registration
-
getClassName
String getClassName()
Gets the fully qualified class name of the Servlet or Filter that is represented by this Registration.- Returns:
- the fully qualified class name of the Servlet or Filter that is represented by this Registration, or null if this Registration is preliminary
-
setInitParameter
boolean setInitParameter(String name, String value)
Sets the initialization parameter with the given name and value on the Servlet or Filter that is represented by this Registration.- Parameters:
name
- the initialization parameter namevalue
- the initialization parameter value- Returns:
- true if the update was successful, i.e., an initialization parameter with the given name did not already exist for the Servlet or Filter represented by this Registration, and false otherwise
- Throws:
IllegalStateException
- if the ServletContext from which this Registration was obtained has already been initializedIllegalArgumentException
- if the given name or value is null
-
getInitParameter
String getInitParameter(String name)
Gets the value of the initialization parameter with the given name that will be used to initialize the Servlet or Filter represented by this Registration object.- Parameters:
name
- the name of the initialization parameter whose value is requested- Returns:
- the value of the initialization parameter with the given name, or null if no initialization parameter with the given name exists
-
setInitParameters
Set<String> setInitParameters(Map<String,String> initParameters)
Sets the given initialization parameters on the Servlet or Filter that is represented by this Registration.The given map of initialization parameters is processed by-value, i.e., for each initialization parameter contained in the map, this method calls
setInitParameter(String,String)
. If that method would return false for any of the initialization parameters in the given map, no updates will be performed, and false will be returned. Likewise, if the map contains an initialization parameter with a null name or value, no updates will be performed, and an IllegalArgumentException will be thrown.- Parameters:
initParameters
- the initialization parameters- Returns:
- the (possibly empty) Set of initialization parameter names that are in conflict
- Throws:
IllegalStateException
- if the ServletContext from which this Registration was obtained has already been initializedIllegalArgumentException
- if the given map contains an initialization parameter with a null name or value
-
getInitParameters
Map<String,String> getInitParameters()
Gets an immutable (and possibly empty) Map containing the currently available initialization parameters that will be used to initialize the Servlet or Filter represented by this Registration object.- Returns:
- Map containing the currently available initialization parameters that will be used to initialize the Servlet or Filter represented by this Registration object
-
-
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/Registration.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
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.