|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exist.http.servlets.HttpServletRequestWrapper
A wrapper for HttpServletRequest A method of differentiating between POST parameters in the URL or Content Body of the request was needed. The standard javax.servlet.http.HTTPServletRequest does not differentiate between URL or content body parameters, this class does, the type is indicated in RequestParameter.type. To differentiate manually we need to read the URL (getQueryString()) and the Content body (getInputStream()), this is problematic with the standard javax.servlet.http.HTTPServletRequest as parameter functions (getParameterMap(), getParameterNames(), getParameter(String), getParameterValues(String)) affect the input stream functions (getInputStream(), getReader()) and vice versa. This class solves this by reading the Request Parameters initially from both the URL and the Content Body of the Request and storing them in the private variable params for later use.
| Constructor Summary | |
HttpServletRequestWrapper(HttpServletRequest request,
java.lang.String formEncoding)
HttpServletRequestWrapper Constructor |
|
| Method Summary | |
java.lang.Object |
getAttribute(java.lang.String name)
|
java.util.Enumeration |
getAttributeNames()
|
java.lang.String |
getAuthType()
|
java.lang.String |
getCharacterEncoding()
|
int |
getContentLength()
|
java.lang.String |
getContentType()
|
java.lang.String |
getContextPath()
|
Cookie[] |
getCookies()
|
long |
getDateHeader(java.lang.String name)
|
java.lang.String |
getHeader(java.lang.String name)
|
java.util.Enumeration |
getHeaderNames()
|
java.util.Enumeration |
getHeaders(java.lang.String name)
|
ServletInputStream |
getInputStream()
|
int |
getIntHeader(java.lang.String name)
|
java.lang.String |
getLocalAddr()
|
java.util.Locale |
getLocale()
|
java.util.Enumeration |
getLocales()
|
java.lang.String |
getLocalName()
|
int |
getLocalPort()
|
java.lang.String |
getMethod()
|
java.lang.String |
getParameter(java.lang.String name)
get the value of a Request parameter by its name from the local parameter store |
java.util.Map |
getParameterMap()
get a Map of Request parameters (keys and values) from the local parameter store |
java.util.Enumeration |
getParameterNames()
get the names of the Request parameters from the local parameter store |
java.lang.String[] |
getParameterValues(java.lang.String name)
get the values of the Request parameter indicated by name from the local parameter store |
java.lang.String |
getPathInfo()
|
java.lang.String |
getPathTranslated()
|
java.lang.String |
getProtocol()
|
java.lang.String |
getQueryString()
|
java.io.BufferedReader |
getReader()
|
java.lang.String |
getRealPath(java.lang.String path)
|
java.lang.String |
getRemoteAddr()
|
java.lang.String |
getRemoteHost()
|
int |
getRemotePort()
|
java.lang.String |
getRemoteUser()
|
RequestDispatcher |
getRequestDispatcher(java.lang.String name)
|
java.lang.String |
getRequestedSessionId()
|
java.lang.String |
getRequestURI()
|
java.lang.StringBuffer |
getRequestURL()
|
java.lang.String |
getScheme()
|
java.lang.String |
getServerName()
|
int |
getServerPort()
|
java.lang.String |
getServletPath()
|
HttpSession |
getSession()
|
HttpSession |
getSession(boolean create)
|
java.security.Principal |
getUserPrincipal()
|
boolean |
isRequestedSessionIdFromCookie()
|
boolean |
isRequestedSessionIdFromUrl()
|
boolean |
isRequestedSessionIdFromURL()
|
boolean |
isRequestedSessionIdValid()
|
boolean |
isSecure()
|
boolean |
isUserInRole(java.lang.String name)
|
void |
removeAttribute(java.lang.String name)
|
void |
setAttribute(java.lang.String name,
java.lang.Object o)
|
void |
setCharacterEncoding(java.lang.String env)
|
java.lang.String |
toString()
Similar to javax.servlet.http.HttpServletRequest.toString() except it includes output of the Request parameters from the Request's Content Body |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public HttpServletRequestWrapper(HttpServletRequest request,
java.lang.String formEncoding)
throws java.io.UnsupportedEncodingException
request - The HttpServletRequest to wrapformEncoding - The encoding to use| Method Detail |
public java.lang.String getAuthType()
javax.servlet.http.HttpServletRequest#getAuthTypepublic Cookie[] getCookies()
javax.servlet.http.HttpServletRequest#getCookiespublic long getDateHeader(java.lang.String name)
javax.servlet.http.HttpServletRequest#getDateHeaderpublic java.lang.String getHeader(java.lang.String name)
javax.servlet.http.HttpServletRequest#getHeaderpublic java.util.Enumeration getHeaders(java.lang.String name)
javax.servlet.http.HttpServletRequest#getHeaderspublic java.util.Enumeration getHeaderNames()
javax.servlet.http.HttpServletRequest#getHeaderNamespublic int getIntHeader(java.lang.String name)
javax.servlet.http.HttpServletRequest#getIntHeaderpublic java.lang.String getMethod()
javax.servlet.http.HttpServletRequest#getMethodpublic java.lang.String getPathInfo()
javax.servlet.http.HttpServletRequest#getPathInfopublic java.lang.String getPathTranslated()
javax.servlet.http.HttpServletRequest#getPathTranslatedpublic java.lang.String getContextPath()
javax.servlet.http.HttpServletRequest#getContextPathpublic java.lang.String getQueryString()
javax.servlet.http.HttpServletRequest#getQueryStringpublic java.lang.String getRemoteUser()
javax.servlet.http.HttpServletRequest#getRemoteUserpublic boolean isUserInRole(java.lang.String name)
javax.servlet.http.HttpServletRequest#isUserInRolepublic java.security.Principal getUserPrincipal()
javax.servlet.http.HttpServletRequest#getUserPrincipalpublic java.lang.String getRequestedSessionId()
javax.servlet.http.HttpServletRequest#getRequestedSessionIdpublic java.lang.String getRequestURI()
javax.servlet.http.HttpServletRequest#getRequestURIpublic java.lang.StringBuffer getRequestURL()
javax.servlet.http.HttpServletRequest#getRequestedURLpublic java.lang.String getServletPath()
javax.servlet.http.HttpServletRequest#getServletPathpublic HttpSession getSession(boolean create)
javax.servlet.http.HttpServletRequest#getSessionpublic HttpSession getSession()
javax.servlet.http.HttpServletRequest#getSessionpublic boolean isRequestedSessionIdValid()
javax.servlet.http.HttpServletRequest#isRequestedSessionIdValiepublic boolean isRequestedSessionIdFromCookie()
javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromCookiepublic boolean isRequestedSessionIdFromURL()
javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromURLpublic boolean isRequestedSessionIdFromUrl()
javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromUrlpublic java.lang.Object getAttribute(java.lang.String name)
javax.servlet.http.HttpServletRequest#getAttributepublic java.util.Enumeration getAttributeNames()
javax.servlet.http.HttpServletRequest#getAttributeNamespublic java.lang.String getCharacterEncoding()
javax.servlet.http.HttpServletRequest#getCharacterEncoding
public void setCharacterEncoding(java.lang.String env)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionjavax.servlet.http.HttpServletRequest#setCharacterEncodingpublic int getContentLength()
javax.servlet.http.HttpServletRequest#getContentLengthpublic java.lang.String getContentType()
javax.servlet.http.HttpServletRequest#getContentType
public ServletInputStream getInputStream()
throws java.io.IOException
java.io.IOExceptionjavax.servlet.http.HttpServletRequest#getInputStreampublic java.lang.String getParameter(java.lang.String name)
name - The name of the Request parameter to get the value for
public java.util.Enumeration getParameterNames()
public java.lang.String[] getParameterValues(java.lang.String name)
name - The name of the Request parameter to get the values for
public java.util.Map getParameterMap()
public java.lang.String getProtocol()
javax.servlet.http.HttpServletRequest#getProtocolpublic java.lang.String getScheme()
javax.servlet.http.HttpServletRequest#getSchemepublic java.lang.String getServerName()
javax.servlet.http.HttpServletRequest#getServerNamepublic int getServerPort()
javax.servlet.http.HttpServletRequest#getServerPort
public java.io.BufferedReader getReader()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getRemoteAddr()
javax.servlet.http.HttpServletRequest#getRemoteAddrpublic java.lang.String getRemoteHost()
javax.servlet.http.HttpServletRequest#getRemoteHost
public void setAttribute(java.lang.String name,
java.lang.Object o)
javax.servlet.http.HttpServletRequest#setAttributepublic void removeAttribute(java.lang.String name)
javax.servlet.http.HttpServletRequest#removeAttributepublic java.util.Locale getLocale()
javax.servlet.http.HttpServletRequest#getLocalepublic java.util.Enumeration getLocales()
javax.servlet.http.HttpServletRequest#getLocalespublic boolean isSecure()
javax.servlet.http.HttpServletRequest#isSecurepublic RequestDispatcher getRequestDispatcher(java.lang.String name)
javax.servlet.http.HttpServletRequest#getRequestDispatcherpublic java.lang.String getRealPath(java.lang.String path)
javax.servlet.http.HttpServletRequest#getRealPathpublic int getRemotePort()
javax.servlet.http.HttpServletRequest#getRemotePortpublic java.lang.String getLocalName()
javax.servlet.http.HttpServletRequest#getLocalNamepublic java.lang.String getLocalAddr()
javax.servlet.http.HttpServletRequest#getLocalAddrpublic int getLocalPort()
javax.servlet.http.HttpServletRequest#getLocalPortpublic java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||