public abstract class GenericFilter
extends java.lang.Object
implements jakarta.servlet.Filter
| Modifier and Type | Field and Description |
|---|---|
protected jakarta.servlet.FilterConfig |
_config |
| Modifier | Constructor and Description |
|---|---|
protected |
GenericFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Called by the web container to indicate to a filter that it is
being taken out of service.
|
protected void |
forward(jakarta.servlet.ServletRequest request,
jakarta.servlet.ServletResponse response,
java.lang.String uri)
Forward to the specified page.
|
protected void |
forward(jakarta.servlet.ServletRequest request,
jakarta.servlet.ServletResponse response,
java.lang.String uri,
java.util.Map params,
int mode)
Forward to the specified page with parameters.
|
java.lang.String |
getFilterName()
Returns the filter's name.
|
java.lang.String |
getInitParameter(java.lang.String name)
Returns a String containing the value of the named initialization
parameter, or null if the parameter does not exist.
|
java.util.Enumeration |
getInitParameterNames()
Returns a String containing the value of the named initialization
parameter, or null if the parameter does not exist.
|
jakarta.servlet.ServletContext |
getServletContext()
Returns the servlet context in which this filter is running.
|
protected void |
include(jakarta.servlet.ServletRequest request,
jakarta.servlet.ServletResponse response,
java.lang.String uri)
Includes the specified page.
|
protected void |
include(jakarta.servlet.ServletRequest request,
jakarta.servlet.ServletResponse response,
java.lang.String uri,
java.util.Map params,
int mode)
Includes the specified page with parameters.
|
protected void |
init()
A convenience method which can be overridden so that there's
no need to call super.init(config).
|
void |
init(jakarta.servlet.FilterConfig config)
Called by the web container to indicate to a filter that it is
being placed into service.
|
protected void |
sendRedirect(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response,
java.lang.String page,
java.util.Map params,
int mode)
Redirects to another page.
|
protected void init()
throws jakarta.servlet.ServletException
jakarta.servlet.ServletExceptioninit(FilterConfig)public final void init(jakarta.servlet.FilterConfig config)
throws jakarta.servlet.ServletException
init().init in interface jakarta.servlet.Filterjakarta.servlet.ServletExceptionpublic final java.lang.String getInitParameter(java.lang.String name)
public final java.util.Enumeration getInitParameterNames()
public final java.lang.String getFilterName()
public final jakarta.servlet.ServletContext getServletContext()
protected void sendRedirect(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response,
java.lang.String page,
java.util.Map params,
int mode)
throws jakarta.servlet.ServletException,
java.io.IOException
It resolves "*" contained in URI, if any, to the proper Locale,
and the browser code.
Refer to Servlets.locate(ServletContext, ServletRequest, String, Locator)
for details.
page - the page's uri; null to denote the same requestmode - one of Servlets.OVERWRITE_URI, Servlets.IGNORE_PARAM,
and Servlets.APPEND_PARAM. It defines how to handle if both uri
and params contains the same parameter.
mode is used only if both uri contains query string and params is
not empty.jakarta.servlet.ServletExceptionjava.io.IOExceptionprotected final void forward(jakarta.servlet.ServletRequest request,
jakarta.servlet.ServletResponse response,
java.lang.String uri)
throws jakarta.servlet.ServletException,
java.io.IOException
It resolves "*" contained in URI, if any, to the proper Locale,
and the browser code.
Refer to Servlets.locate(ServletContext, ServletRequest, String, Locator)
for details.
jakarta.servlet.ServletExceptionjava.io.IOExceptionprotected final void forward(jakarta.servlet.ServletRequest request,
jakarta.servlet.ServletResponse response,
java.lang.String uri,
java.util.Map params,
int mode)
throws jakarta.servlet.ServletException,
java.io.IOException
It resolves "*" contained in URI, if any, to the proper Locale,
and the browser code.
Refer to Servlets.locate(ServletContext, ServletRequest, String, Locator)
for details.
jakarta.servlet.ServletExceptionjava.io.IOExceptionprotected final void include(jakarta.servlet.ServletRequest request,
jakarta.servlet.ServletResponse response,
java.lang.String uri)
throws jakarta.servlet.ServletException,
java.io.IOException
It resolves "*" contained in URI, if any, to the proper Locale,
and the browser code.
Refer to Servlets.locate(ServletContext, ServletRequest, String, Locator)
for details.
jakarta.servlet.ServletExceptionjava.io.IOExceptionprotected final void include(jakarta.servlet.ServletRequest request,
jakarta.servlet.ServletResponse response,
java.lang.String uri,
java.util.Map params,
int mode)
throws jakarta.servlet.ServletException,
java.io.IOException
It resolves "*" contained in URI, if any, to the proper Locale,
and the browser code.
Refer to Servlets.locate(ServletContext, ServletRequest, String, Locator)
for details.
jakarta.servlet.ServletExceptionjava.io.IOExceptionpublic void destroy()
This implementation does nothing.
destroy in interface jakarta.servlet.FilterCopyright © 2005-2022 Potix Corporation. All Rights Reserved.