velosurf.util
Class SavedRequestWrapper

java.lang.Object
  extended by javax.servlet.ServletRequestWrapper
      extended by javax.servlet.http.HttpServletRequestWrapper
          extended by velosurf.util.SavedRequestWrapper
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class SavedRequestWrapper
extends javax.servlet.http.HttpServletRequestWrapper

This class provides request parameters, headers, cookies from original requrest or saved request.

View Source

Author:
Andrey Grebnev <andrey.grebnev@blandware.com>

Field Summary
protected static java.util.Locale defaultLocale
          The default Locale if none are specified.
protected  java.text.SimpleDateFormat[] formats
          The set of SimpleDateFormat formats to use in getDateHeader().
protected static java.util.TimeZone GMT_ZONE
           
protected  SavedRequest savedRequest
           
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
SavedRequestWrapper(javax.servlet.http.HttpServletRequest request)
           
 
Method Summary
 javax.servlet.http.Cookie[] getCookies()
          The default behavior of this method is to return getCookies() on the wrapped request object.
 long getDateHeader(java.lang.String name)
          The default behavior of this method is to return getDateHeader(String name) on the wrapped request object.
 java.lang.String getHeader(java.lang.String name)
          The default behavior of this method is to return getHeader(String name) on the wrapped request object.
 java.util.Enumeration getHeaderNames()
          The default behavior of this method is to return getHeaderNames() on the wrapped request object.
 java.util.Enumeration getHeaders(java.lang.String name)
          The default behavior of this method is to return getHeaders(String name) on the wrapped request object.
 int getIntHeader(java.lang.String name)
          The default behavior of this method is to return getIntHeader(String name) on the wrapped request object.
 java.util.Locale getLocale()
          The default behavior of this method is to return getLocale() on the wrapped request object.
 java.util.Enumeration getLocales()
          The default behavior of this method is to return getLocales() on the wrapped request object.
 java.lang.String getMethod()
          The default behavior of this method is to return getMethod() on the wrapped request object.
 java.lang.String getParameter(java.lang.String name)
          The default behavior of this method is to return getParameter(String name) on the wrapped request object.
 java.util.Map getParameterMap()
          The default behavior of this method is to return getParameterMap() on the wrapped request object.
 java.util.Enumeration getParameterNames()
          The default behavior of this method is to return getParameterNames() on the wrapped request object.
 java.lang.String[] getParameterValues(java.lang.String name)
          The default behavior of this method is to return getParameterValues(String name) on the wrapped request object.
 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getAuthType, getContextPath, 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, getLocalName, getLocalPort, 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, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Field Detail

savedRequest

protected SavedRequest savedRequest

GMT_ZONE

protected static final java.util.TimeZone GMT_ZONE

defaultLocale

protected static final java.util.Locale defaultLocale
The default Locale if none are specified.


formats

protected java.text.SimpleDateFormat[] formats
The set of SimpleDateFormat formats to use in getDateHeader(). Notice that because SimpleDateFormat is not thread-safe, we can't declare formats[] as a static variable.

Constructor Detail

SavedRequestWrapper

public SavedRequestWrapper(javax.servlet.http.HttpServletRequest request)
Method Detail

getMethod

public java.lang.String getMethod()
The default behavior of this method is to return getMethod() on the wrapped request object.

Specified by:
getMethod in interface javax.servlet.http.HttpServletRequest
Overrides:
getMethod in class javax.servlet.http.HttpServletRequestWrapper

getHeader

public java.lang.String getHeader(java.lang.String name)
The default behavior of this method is to return getHeader(String name) on the wrapped request object.

Specified by:
getHeader in interface javax.servlet.http.HttpServletRequest
Overrides:
getHeader in class javax.servlet.http.HttpServletRequestWrapper

getIntHeader

public int getIntHeader(java.lang.String name)
The default behavior of this method is to return getIntHeader(String name) on the wrapped request object.

Specified by:
getIntHeader in interface javax.servlet.http.HttpServletRequest
Overrides:
getIntHeader in class javax.servlet.http.HttpServletRequestWrapper

getDateHeader

public long getDateHeader(java.lang.String name)
The default behavior of this method is to return getDateHeader(String name) on the wrapped request object.

Specified by:
getDateHeader in interface javax.servlet.http.HttpServletRequest
Overrides:
getDateHeader in class javax.servlet.http.HttpServletRequestWrapper

getHeaderNames

public java.util.Enumeration getHeaderNames()
The default behavior of this method is to return getHeaderNames() on the wrapped request object.

Specified by:
getHeaderNames in interface javax.servlet.http.HttpServletRequest
Overrides:
getHeaderNames in class javax.servlet.http.HttpServletRequestWrapper

getHeaders

public java.util.Enumeration getHeaders(java.lang.String name)
The default behavior of this method is to return getHeaders(String name) on the wrapped request object.

Specified by:
getHeaders in interface javax.servlet.http.HttpServletRequest
Overrides:
getHeaders in class javax.servlet.http.HttpServletRequestWrapper

getCookies

public javax.servlet.http.Cookie[] getCookies()
The default behavior of this method is to return getCookies() on the wrapped request object.

Specified by:
getCookies in interface javax.servlet.http.HttpServletRequest
Overrides:
getCookies in class javax.servlet.http.HttpServletRequestWrapper

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
The default behavior of this method is to return getParameterValues(String name) on the wrapped request object.

Specified by:
getParameterValues in interface javax.servlet.ServletRequest
Overrides:
getParameterValues in class javax.servlet.ServletRequestWrapper

getParameterNames

public java.util.Enumeration getParameterNames()
The default behavior of this method is to return getParameterNames() on the wrapped request object.

Specified by:
getParameterNames in interface javax.servlet.ServletRequest
Overrides:
getParameterNames in class javax.servlet.ServletRequestWrapper

getParameterMap

public java.util.Map getParameterMap()
The default behavior of this method is to return getParameterMap() on the wrapped request object.

Specified by:
getParameterMap in interface javax.servlet.ServletRequest
Overrides:
getParameterMap in class javax.servlet.ServletRequestWrapper

getParameter

public java.lang.String getParameter(java.lang.String name)
The default behavior of this method is to return getParameter(String name) on the wrapped request object.

Specified by:
getParameter in interface javax.servlet.ServletRequest
Overrides:
getParameter in class javax.servlet.ServletRequestWrapper

getLocales

public java.util.Enumeration getLocales()
The default behavior of this method is to return getLocales() on the wrapped request object.

Specified by:
getLocales in interface javax.servlet.ServletRequest
Overrides:
getLocales in class javax.servlet.ServletRequestWrapper

getLocale

public java.util.Locale getLocale()
The default behavior of this method is to return getLocale() on the wrapped request object.

Specified by:
getLocale in interface javax.servlet.ServletRequest
Overrides:
getLocale in class javax.servlet.ServletRequestWrapper


~ooOoo~