public class ClientInfoFilter extends Object implements SecurityFilter
ThreadContext so it can be forwarded to useful areas of interest. Also contains the constants
for working with the client info map.
The information currently all comes from the servlet API; specifically a select few getters
within ServletRequest. The format of the keys follows the format of java
beans. The keys are camel-cased names without the preceeding 'get' found in the method name.
For example, the key associated with ServletRequest.getRemoteAddr()
would be the string remoteAddr.
The only exception to this rule, CLIENT_INFO_KEY, which holds a value
string of client-info, is the key used to access the entire client information map. It
may contain different kinds of data that does not necessarily correlate to the servlet API.
| Modifier and Type | Field and Description |
|---|---|
static String |
CLIENT_INFO_KEY |
static String |
SERVLET_CONTEXT_PATH |
static String |
SERVLET_REMOTE_ADDR |
static String |
SERVLET_REMOTE_HOST |
static String |
SERVLET_SCHEME |
| Constructor and Description |
|---|
ClientInfoFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain) |
void |
init(javax.servlet.FilterConfig filterConfig) |
public static final String CLIENT_INFO_KEY
public static final String SERVLET_REMOTE_ADDR
public static final String SERVLET_REMOTE_HOST
public static final String SERVLET_SCHEME
public static final String SERVLET_CONTEXT_PATH
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
init in interface javax.servlet.Filterjavax.servlet.ServletExceptionpublic void destroy()
destroy in interface javax.servlet.Filterpublic void doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
throws IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.FilterIOExceptionjavax.servlet.ServletExceptionThis work is licensed under a Creative Commons Attribution 4.0 International License.