This class functions as a wrapper around HttpServletRequest to
provide working getParameter methods for multipart requests. Once
Struts requires Servlet 2.3, this class will definately be changed to
extend javax.servlet.http.HttpServletRequestWrapper instead of
implementing HttpServletRequest. Servlet 2.3 methods are implemented
to return
null
or do nothing if called on. Use
getRequest
to retrieve the underlying HttpServletRequest
object and call on the 2.3 method there, the empty methods are here only
so that this will compile with the Servlet 2.3 jar. This class exists temporarily
in the process() method of ActionServlet, just before the ActionForward is processed
and just after the Action is performed, the request is set back to the original
HttpServletRequest object.
getAttribute
public Object getAttribute(String name)
getAttributeNames
public Enumeration getAttributeNames()
getAuthType
public String getAuthType()
getCharacterEncoding
public String getCharacterEncoding()
getContentLength
public int getContentLength()
getContentType
public String getContentType()
getContextPath
public String getContextPath()
getCookies
public Cookie[] getCookies()
getDateHeader
public long getDateHeader(String name)
getHeader
public String getHeader(String name)
getHeaderNames
public Enumeration getHeaderNames()
getHeaders
public Enumeration getHeaders(String name)
getInputStream
public ServletInputStream getInputStream()
throws IOException
getIntHeader
public int getIntHeader(String name)
getLocalAddr
public String getLocalAddr()
Use Reflection to invoke Servlet 2.4 getLocalAddr
method on the wrapped Request.
getLocalName
public String getLocalName()
Use Reflection to invoke Servlet 2.4 getLocalName
method on the wrapped Request.
getLocalPort
public int getLocalPort()
Use Reflection to invoke Servlet 2.4 getLocalPort
method on the wrapped Request.
getLocale
public Locale getLocale()
getLocales
public Enumeration getLocales()
getMethod
public String getMethod()
getParameter
public String getParameter(String name)
Attempts to get a parameter for this request. It first looks in the
underlying HttpServletRequest object for the parameter, and if that
doesn't exist it looks for the parameters retrieved from the multipart
request
getParameterMap
public Map getParameterMap()
Implements the Servlet 2.3 getParameterMap method.
getParameterNames
public Enumeration getParameterNames()
Returns the names of the parameters for this request.
The enumeration consists of the normal request parameter
names plus the parameters read from the multipart request
getParameterValues
public String[] getParameterValues(String name)
getPathInfo
public String getPathInfo()
getPathTranslated
public String getPathTranslated()
getProtocol
public String getProtocol()
getQueryString
public String getQueryString()
getReader
public BufferedReader getReader()
throws IOException
getRealPath
public String getRealPath(String path)
getRemoteAddr
public String getRemoteAddr()
getRemoteHost
public String getRemoteHost()
getRemotePort
public int getRemotePort()
Use Reflection to invoke Servlet 2.4 getRemotePort
method on the wrapped Request.
getRemoteUser
public String getRemoteUser()
getRequest
public HttpServletRequest getRequest()
Returns the underlying HttpServletRequest for this wrapper
getRequestDispatcher
public RequestDispatcher getRequestDispatcher(String path)
getRequestURI
public String getRequestURI()
getRequestURL
public StringBuffer getRequestURL()
Use Reflection to invoke Servlet 2.3 getRequestURL
method on the wrapped Request.
getRequestedSessionId
public String getRequestedSessionId()
getScheme
public String getScheme()
getServerName
public String getServerName()
getServerPort
public int getServerPort()
getServletPath
public String getServletPath()
getSession
public HttpSession getSession()
getSession
public HttpSession getSession(boolean create)
getUserPrincipal
public Principal getUserPrincipal()
invokeRequestMethod
private Object invokeRequestMethod(String name,
Object[] args)
Convenience method which uses reflection to invoke a method
on the Request.
isRequestedSessionIdFromCookie
public boolean isRequestedSessionIdFromCookie()
Use Reflection to invoke Servlet 2.3 isRequestedSessionIdFromCookie
method on the wrapped Request.
isRequestedSessionIdFromURL
public boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromUrl
public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdValid
public boolean isRequestedSessionIdValid()
isSecure
public boolean isSecure()
isUserInRole
public boolean isUserInRole(String user)
removeAttribute
public void removeAttribute(String name)
setAttribute
public void setAttribute(String name,
Object o)
setCharacterEncoding
public void setCharacterEncoding(String encoding)
Use Reflection to invoke Servlet 2.3 setCharacterEncoding
method on the wrapped Request.
setParameter
public void setParameter(String name,
String value)
Sets a parameter for this request. The parameter is actually
separate from the request parameters, but calling on the
getParameter() methods of this class will work as if they weren't.