|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.ServletRequestWrapper
javax.servlet.http.HttpServletRequestWrapper
org.sitemesh.webapp.contentfilter.HttpServletRequestFilterable
public class HttpServletRequestFilterable
This special HttpServletRequestWrapper is used to allow filtering of the HTTP headers by adding them to an exclusion list. The initial need for this wrapper came up when the decorator is modified and the client/browser sends over the If-Modified-Since header to the server. The result is the servlet container sends back a 304 and changes to the decorator are never rendered until the requested resource is modified. TODO: Implement any method that may be used to obtain the headers which are filtered. i.e., HttpServletRequest#getHeaderNames()
| Field Summary | |
|---|---|
protected Set<String> |
exclusionsHeaders
The HTTP Headers that will be removed when filtering is enabled. |
| Fields inherited from interface javax.servlet.http.HttpServletRequest |
|---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
| Constructor Summary | |
|---|---|
HttpServletRequestFilterable(javax.servlet.http.HttpServletRequest httpServletRequest)
|
|
| Method Summary | |
|---|---|
void |
addExclusion(String header)
This method will add the header name to the list of headers to be filtered. |
long |
getDateHeader(String header)
|
String |
getHeader(String header)
This customized version of HttpServletRequest#getHeader(String) returns null for any HTTP header that is being filtered out. |
protected boolean |
isExcluded(String header)
This method checks to see if the header name is within the exclusion list. |
protected String |
normalize(String header)
|
| Methods inherited from class javax.servlet.http.HttpServletRequestWrapper |
|---|
getAuthType, getContextPath, getCookies, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole |
| Methods inherited from class javax.servlet.ServletRequestWrapper |
|---|
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setRequest |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.ServletRequest |
|---|
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding |
| Field Detail |
|---|
protected Set<String> exclusionsHeaders
| Constructor Detail |
|---|
public HttpServletRequestFilterable(javax.servlet.http.HttpServletRequest httpServletRequest)
HttpServletRequestWrapper.HttpServletRequestWrapper(HttpServletRequest)| Method Detail |
|---|
public String getHeader(String header)
getHeader in interface javax.servlet.http.HttpServletRequestgetHeader in class javax.servlet.http.HttpServletRequestWrapperheader - The HTTP header name.
public long getDateHeader(String header)
getDateHeader in interface javax.servlet.http.HttpServletRequestgetDateHeader in class javax.servlet.http.HttpServletRequestWrapperprotected boolean isExcluded(String header)
header - The header name to check if it's excluded.
protected String normalize(String header)
public void addExclusion(String header)
header - The header name to be excluded.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||