|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.apache.struts.upload.MultipartRequestWrapper
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.
| Field Summary | |
private static org.apache.commons.logging.Log |
log
Logging instance |
protected java.util.Map |
parameters
The parameters for this multipart request |
protected javax.servlet.http.HttpServletRequest |
request
The underlying HttpServletRequest |
| Constructor Summary | |
MultipartRequestWrapper(javax.servlet.http.HttpServletRequest request)
|
|
| 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()
|
javax.servlet.http.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)
|
javax.servlet.ServletInputStream |
getInputStream()
|
int |
getIntHeader(java.lang.String name)
|
java.lang.String |
getLocalAddr()
Use Reflection to invoke Servlet 2.4 getLocalAddr method on the wrapped Request. |
java.util.Locale |
getLocale()
|
java.util.Enumeration |
getLocales()
|
java.lang.String |
getLocalName()
Use Reflection to invoke Servlet 2.4 getLocalName method on the wrapped Request. |
int |
getLocalPort()
Use Reflection to invoke Servlet 2.4 getLocalPort method on the wrapped Request. |
java.lang.String |
getMethod()
|
java.lang.String |
getParameter(java.lang.String name)
Attempts to get a parameter for this request. |
java.util.Map |
getParameterMap()
Implements the Servlet 2.3 getParameterMap method. |
java.util.Enumeration |
getParameterNames()
Returns the names of the parameters for this request. |
java.lang.String[] |
getParameterValues(java.lang.String name)
|
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()
Use Reflection to invoke Servlet 2.4 getRemotePort method on the wrapped Request. |
java.lang.String |
getRemoteUser()
|
javax.servlet.http.HttpServletRequest |
getRequest()
Returns the underlying HttpServletRequest for this wrapper |
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String path)
|
java.lang.String |
getRequestedSessionId()
|
java.lang.String |
getRequestURI()
|
java.lang.StringBuffer |
getRequestURL()
Use Reflection to invoke Servlet 2.3 getRequestURL method on the wrapped Request. |
java.lang.String |
getScheme()
|
java.lang.String |
getServerName()
|
int |
getServerPort()
|
java.lang.String |
getServletPath()
|
javax.servlet.http.HttpSession |
getSession()
|
javax.servlet.http.HttpSession |
getSession(boolean create)
|
java.security.Principal |
getUserPrincipal()
|
private java.lang.Object |
invokeRequestMethod(java.lang.String name,
java.lang.Object[] args)
Convenience method which uses reflection to invoke a method on the Request. |
boolean |
isRequestedSessionIdFromCookie()
Use Reflection to invoke Servlet 2.3 isRequestedSessionIdFromCookie method on the wrapped Request. |
boolean |
isRequestedSessionIdFromUrl()
|
boolean |
isRequestedSessionIdFromURL()
|
boolean |
isRequestedSessionIdValid()
|
boolean |
isSecure()
|
boolean |
isUserInRole(java.lang.String user)
|
void |
removeAttribute(java.lang.String name)
|
void |
setAttribute(java.lang.String name,
java.lang.Object o)
|
void |
setCharacterEncoding(java.lang.String encoding)
Use Reflection to invoke Servlet 2.3 setCharacterEncoding method on the wrapped Request. |
void |
setParameter(java.lang.String name,
java.lang.String value)
Sets a parameter for this request. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static final org.apache.commons.logging.Log log
protected java.util.Map parameters
protected javax.servlet.http.HttpServletRequest request
| Constructor Detail |
public MultipartRequestWrapper(javax.servlet.http.HttpServletRequest request)
| Method Detail |
public void setParameter(java.lang.String name,
java.lang.String value)
public java.lang.String getParameter(java.lang.String name)
getParameter in interface javax.servlet.ServletRequestpublic java.util.Enumeration getParameterNames()
getParameterNames in interface javax.servlet.ServletRequestpublic java.lang.String[] getParameterValues(java.lang.String name)
getParameterValues in interface javax.servlet.ServletRequestpublic javax.servlet.http.HttpServletRequest getRequest()
public java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface javax.servlet.ServletRequestpublic java.util.Enumeration getAttributeNames()
getAttributeNames in interface javax.servlet.ServletRequestpublic java.lang.String getCharacterEncoding()
getCharacterEncoding in interface javax.servlet.ServletRequestpublic int getContentLength()
getContentLength in interface javax.servlet.ServletRequestpublic java.lang.String getContentType()
getContentType in interface javax.servlet.ServletRequest
public javax.servlet.ServletInputStream getInputStream()
throws java.io.IOException
getInputStream in interface javax.servlet.ServletRequestpublic java.lang.String getProtocol()
getProtocol in interface javax.servlet.ServletRequestpublic java.lang.String getScheme()
getScheme in interface javax.servlet.ServletRequestpublic java.lang.String getServerName()
getServerName in interface javax.servlet.ServletRequestpublic int getServerPort()
getServerPort in interface javax.servlet.ServletRequest
public java.io.BufferedReader getReader()
throws java.io.IOException
getReader in interface javax.servlet.ServletRequestpublic java.lang.String getRemoteAddr()
getRemoteAddr in interface javax.servlet.ServletRequestpublic java.lang.String getRemoteHost()
getRemoteHost in interface javax.servlet.ServletRequest
public void setAttribute(java.lang.String name,
java.lang.Object o)
setAttribute in interface javax.servlet.ServletRequestpublic void removeAttribute(java.lang.String name)
removeAttribute in interface javax.servlet.ServletRequestpublic java.util.Locale getLocale()
getLocale in interface javax.servlet.ServletRequestpublic java.util.Enumeration getLocales()
getLocales in interface javax.servlet.ServletRequestpublic boolean isSecure()
isSecure in interface javax.servlet.ServletRequestpublic javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
getRequestDispatcher in interface javax.servlet.ServletRequestpublic java.lang.String getRealPath(java.lang.String path)
getRealPath in interface javax.servlet.ServletRequestpublic java.lang.String getAuthType()
getAuthType in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.Cookie[] getCookies()
getCookies in interface javax.servlet.http.HttpServletRequestpublic long getDateHeader(java.lang.String name)
getDateHeader in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getHeader(java.lang.String name)
getHeader in interface javax.servlet.http.HttpServletRequestpublic java.util.Enumeration getHeaders(java.lang.String name)
getHeaders in interface javax.servlet.http.HttpServletRequestpublic java.util.Enumeration getHeaderNames()
getHeaderNames in interface javax.servlet.http.HttpServletRequestpublic int getIntHeader(java.lang.String name)
getIntHeader in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getMethod()
getMethod in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getPathInfo()
getPathInfo in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getPathTranslated()
getPathTranslated in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getContextPath()
getContextPath in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getQueryString()
getQueryString in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getRemoteUser()
getRemoteUser in interface javax.servlet.http.HttpServletRequestpublic boolean isUserInRole(java.lang.String user)
isUserInRole in interface javax.servlet.http.HttpServletRequestpublic java.security.Principal getUserPrincipal()
getUserPrincipal in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getRequestedSessionId()
getRequestedSessionId in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getRequestURI()
getRequestURI in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getServletPath()
getServletPath in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.HttpSession getSession(boolean create)
getSession in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.HttpSession getSession()
getSession in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdValid()
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequestpublic java.util.Map getParameterMap()
public void setCharacterEncoding(java.lang.String encoding)
public java.lang.StringBuffer getRequestURL()
public boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequestpublic java.lang.String getLocalAddr()
public java.lang.String getLocalName()
public int getLocalPort()
public int getRemotePort()
private java.lang.Object invokeRequestMethod(java.lang.String name,
java.lang.Object[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||