-
- All Superinterfaces:
- Registration
- All Known Subinterfaces:
- FilterRegistration.Dynamic
public interface FilterRegistration extends Registration
Interface through which aFilter
may be further configured.- Since:
- Servlet 3.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface and Description static interface
FilterRegistration.Dynamic
Interface through which aFilter
registered via one of the addFilter methods onServletContext
may be further configured.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description void
addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames)
Adds a filter mapping with the given servlet names and dispatcher types for the Filter represented by this FilterRegistration.void
addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns)
Adds a filter mapping with the given url patterns and dispatcher types for the Filter represented by this FilterRegistration.Collection<String>
getServletNameMappings()
Gets the currently available servlet name mappings of the Filter represented by thisFilterRegistration
.Collection<String>
getUrlPatternMappings()
Gets the currently available URL pattern mappings of the Filter represented by thisFilterRegistration
.-
Methods inherited from interface javax.servlet.Registration
getClassName, getInitParameter, getInitParameters, getName, setInitParameter, setInitParameters
-
-
-
-
Method Detail
-
addMappingForServletNames
void addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames)
Adds a filter mapping with the given servlet names and dispatcher types for the Filter represented by this FilterRegistration.Filter mappings are matched in the order in which they were added.
Depending on the value of the isMatchAfter parameter, the given filter mapping will be considered after or before any declared filter mappings of the ServletContext from which this FilterRegistration was obtained.
If this method is called multiple times, each successive call adds to the effects of the former.
- Parameters:
dispatcherTypes
- the dispatcher types of the filter mapping, or null if the default DispatcherType.REQUEST is to be usedisMatchAfter
- true if the given filter mapping should be matched after any declared filter mappings, and false if it is supposed to be matched before any declared filter mappings of the ServletContext from which this FilterRegistration was obtainedservletNames
- the servlet names of the filter mapping- Throws:
IllegalArgumentException
- if servletNames is null or emptyIllegalStateException
- if the ServletContext from which this FilterRegistration was obtained has already been initialized
-
getServletNameMappings
Collection<String> getServletNameMappings()
Gets the currently available servlet name mappings of the Filter represented by thisFilterRegistration
.If permitted, any changes to the returned
Collection
must not affect thisFilterRegistration
.- Returns:
- a (possibly empty)
Collection
of the currently available servlet name mappings of the Filter represented by thisFilterRegistration
-
addMappingForUrlPatterns
void addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns)
Adds a filter mapping with the given url patterns and dispatcher types for the Filter represented by this FilterRegistration.Filter mappings are matched in the order in which they were added.
Depending on the value of the isMatchAfter parameter, the given filter mapping will be considered after or before any declared filter mappings of the ServletContext from which this FilterRegistration was obtained.
If this method is called multiple times, each successive call adds to the effects of the former.
- Parameters:
dispatcherTypes
- the dispatcher types of the filter mapping, or null if the default DispatcherType.REQUEST is to be usedisMatchAfter
- true if the given filter mapping should be matched after any declared filter mappings, and false if it is supposed to be matched before any declared filter mappings of the ServletContext from which this FilterRegistration was obtainedurlPatterns
- the url patterns of the filter mapping- Throws:
IllegalArgumentException
- if urlPatterns is null or emptyIllegalStateException
- if the ServletContext from which this FilterRegistration was obtained has already been initialized
-
getUrlPatternMappings
Collection<String> getUrlPatternMappings()
Gets the currently available URL pattern mappings of the Filter represented by thisFilterRegistration
.If permitted, any changes to the returned
Collection
must not affect thisFilterRegistration
.- Returns:
- a (possibly empty)
Collection
of the currently available URL pattern mappings of the Filter represented by thisFilterRegistration
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/servlet/filterregistration.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.