org.apache.struts.upload
Class MultipartRequestWrapper

java.lang.Object
  extended by javax.servlet.ServletRequestWrapper
      extended by javax.servlet.http.HttpServletRequestWrapper
          extended by org.apache.struts.upload.MultipartRequestWrapper
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class MultipartRequestWrapper
extends javax.servlet.http.HttpServletRequestWrapper

This class functions as a wrapper around HttpServletRequest to provide working getParameter methods for multipart requests.


Field Summary
protected  java.util.Map parameters
           The parameters for this multipart request
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
MultipartRequestWrapper(javax.servlet.http.HttpServletRequest request)
           
 
Method Summary
 java.lang.String getParameter(java.lang.String name)
           Attempts to get a parameter for this request.
 java.util.Map getParameterMap()
           Combines the parameters stored here with those in the underlying request.
 java.util.Enumeration getParameterNames()
           Returns the names of the parameters for this request.
 java.lang.String[] getParameterValues(java.lang.String name)
           Returns the values of a parameter in this request.
 void setParameter(java.lang.String name, java.lang.String value)
           Sets a parameter for this request.
 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, 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, getLocale, getLocales, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, 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, getLocale, getLocales, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Field Detail

parameters

protected java.util.Map parameters

The parameters for this multipart request

Constructor Detail

MultipartRequestWrapper

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

setParameter

public void setParameter(java.lang.String name,
                         java.lang.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.


getParameter

public java.lang.String getParameter(java.lang.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

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

getParameterNames

public java.util.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

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

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)

Returns the values of a parameter in this request. It first looks in the underlying HttpServletRequest object for the parameter, and if that doesn't exist it looks for the parameter retrieved from the multipart request.

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

getParameterMap

public java.util.Map getParameterMap()

Combines the parameters stored here with those in the underlying request. If paramater values in the underlying request take precedence over those stored here.

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


Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.