| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | |
| protected class | |
| public static interface | FilterHolder.WrapFunction
Experimental Wrapper mechanism for Filter objects. |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private transient FilterHolder. | |
| private transient Filter | |
| private transient FilterRegistration. | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Filter | |
| public void | |
| public void | |
| public void | doStart()
Overrides org. |
| public void | doStop()
Method to override to stop the lifecycle
|
| public void | dump(Appendable
The appendable to dump to out, String The indent to apply after any new lines. indent)Overrides org. Implements org. |
| public Filter | |
| public FilterRegistration. | |
| public void | initialize()
Overrides org. |
| public void | |
| public String | toString()
Returns a string representation of the object.
|
| _config | back to summary |
|---|---|
| private transient FilterHolder. | |
| _filter | back to summary |
|---|---|
| private transient Filter _filter | |
| _registration | back to summary |
|---|---|
| private transient FilterRegistration. | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| FilterHolder | back to summary |
|---|---|
| public FilterHolder() Constructor | |
| FilterHolder | back to summary |
|---|---|
| public FilterHolder(Source source) Constructor
| |
| FilterHolder | back to summary |
|---|---|
| public FilterHolder(Class<? extends Filter> filter) Constructor | |
| FilterHolder | back to summary |
|---|---|
| public FilterHolder(Filter filter) Constructor for existing filter.
| |
| createInstance | back to summary |
|---|---|
| protected Filter createInstance() throws Exception Overrides org.
| |
| destroyInstance | back to summary |
|---|---|
| public void destroyInstance(Object o) Overrides org.
| |
| doFilter | back to summary |
|---|---|
| public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException | |
| doStart | back to summary |
|---|---|
| public void doStart() throws Exception Overrides org. Doc from org. Method to override to start the lifecycle | |
| doStop | back to summary |
|---|---|
| public void doStop() throws Exception Overrides org. Doc from org. Method to override to stop the lifecycle | |
| dump | back to summary |
|---|---|
| public void dump(Appendable out, String indent) throws IOException Overrides org. Implements org. Doc from org. Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
| |
| getFilter | back to summary |
|---|---|
| public Filter getFilter() | |
| getRegistration | back to summary |
|---|---|
| public FilterRegistration. | |
| initialize | back to summary |
|---|---|
| public void initialize() throws Exception Overrides org. Doc from org. Do any setup necessary after starting | |
| setFilter | back to summary |
|---|---|
| public void setFilter(Filter filter) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object. | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public String | getFilterName()
Implements jakarta. |
| Config | back to summary |
|---|---|
| pack-priv Config() | |
| getFilterName | back to summary |
|---|---|
| public String getFilterName() Implements jakarta. Doc from jakarta. Returns the filter-name of this filter as defined in the deployment descriptor. | |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | addMappingForServletNames(EnumSet<DispatcherType>
the dispatcher types of the filter mapping, or null if the default
DispatcherType.REQUEST is to be used dispatcherTypes, boolean 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 obtained isMatchAfter, String... the servlet names of the filter mapping servletNames)Implements jakarta. |
| public void | addMappingForUrlPatterns(EnumSet<DispatcherType>
the dispatcher types of the filter mapping, or null if the default
DispatcherType.REQUEST is to be used dispatcherTypes, boolean 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 obtained isMatchAfter, String... the url patterns of the filter mapping urlPatterns)Implements jakarta. |
| public Collection | getServletNameMappings()
Implements jakarta. FilterRegistration.
|
| public Collection | getUrlPatternMappings()
Implements jakarta. FilterRegistration.
|
| Registration | back to summary |
|---|---|
| protected Registration() | |
| addMappingForServletNames | back to summary |
|---|---|
| public void addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames) Implements jakarta. Doc from jakarta. 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.
| |
| addMappingForUrlPatterns | back to summary |
|---|---|
| public void addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns) Implements jakarta. Doc from jakarta. 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.
| |
| getServletNameMappings | back to summary |
|---|---|
| public Collection Implements jakarta. Doc from jakarta. Gets the currently available servlet name mappings of the Filter represented by this
If permitted, any changes to the returned
| |
| getUrlPatternMappings | back to summary |
|---|---|
| public Collection Implements jakarta. Doc from jakarta. Gets the currently available URL pattern mappings of the Filter represented by this
If permitted, any changes to the returned
| |
Beans in ServletContextHandler or WebAppContext that implement this interface
will be called to optionally wrap any newly created Filters
(before their Filter#init(FilterConfig) method is called)
| Modifier and Type | Method and Description |
|---|---|
| public Filter | Returns: the Filter (extend fromWrapper if you do wrap the Filter)the Filter being passed in. filter)Optionally wrap the Filter. |
| Modifier and Type | Method and Description |
|---|---|
| public void | destroy()
Overrides default jakarta. Called by the web container to indicate to a filter that it is being taken out of service. |
| public void | doFilter(ServletRequest
the request, ServletResponse ServletRequest object contains the client's requestthe response, FilterChain ServletResponse object contains the filter's responsethe chain)FilterChain for invoking the next filter or the resourceImplements jakarta. doFilter method of the Filter is called by the container each time a request/response pair is passed
through the chain due to a client request for a resource at the end of the chain.
|
| public Filter | |
| public void | init(FilterConfig
a filterConfig)FilterConfig object containing the filter's configuration and initialization
parametersOverrides default jakarta. Called by the web container to indicate to a filter that it is being placed into service. |
| public String |
| _filter | back to summary |
|---|---|
| private final Filter _filter | |
| Wrapper | back to summary |
|---|---|
| public Wrapper(Filter filter) | |
| destroy | back to summary |
|---|---|
| public void destroy() Overrides default jakarta. Doc from jakarta. Called by the web container to indicate to a filter that it is being taken out of service. This method is only called once all threads within the filter's doFilter method have exited or after a timeout period has passed. After the web container calls this method, it will not call the doFilter method again on this instance of the filter. This method gives the filter an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the filter's current state in memory.
| |
| doFilter | back to summary |
|---|---|
| public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException Implements jakarta. Doc from jakarta. The A typical implementation of this method would follow the following pattern:
| |
| getWrapped | back to summary |
|---|---|
| public Filter getWrapped() Implements org.
| |
| init | back to summary |
|---|---|
| public void init(FilterConfig filterConfig) throws ServletException Overrides default jakarta. Doc from jakarta. Called by the web container to indicate to a filter that it is being placed into service.
The servlet container calls the init method exactly once after instantiating the filter. The init method must
complete successfully before the filter is asked to do any filtering work. The container will ensure that actions
performed in the The web container cannot place the filter into service if the init method either
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |