|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.ServletRequestWrapper
javax.servlet.http.HttpServletRequestWrapper
net.sourceforge.stripes.controller.StripesRequestWrapper
public class StripesRequestWrapper
HttpServletRequestWrapper that is used to make the file upload functionality transparent. Every request handled by Stripes is wrapped. Those containing multipart form file uploads are parsed and treated differently, while normal requests are silently wrapped and all calls are delegated to the real request.
Field Summary |
---|
Fields inherited from interface javax.servlet.http.HttpServletRequest |
---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
Constructor Summary | |
---|---|
StripesRequestWrapper(HttpServletRequest request)
Constructor that will, if the POST is multi-part, parse the POST data and make it available through the normal channels. |
Method Summary | |
---|---|
protected void |
constructMultipartWrapper(HttpServletRequest request)
Responsible for constructing the MultipartWrapper object and setting it on to the instance variable 'multipart'. |
static StripesRequestWrapper |
findStripesWrapper(ServletRequest request)
Looks for the StripesRequesetWrapper for the specific request and returns it. |
Enumeration<String> |
getFileParameterNames()
Returns the names of request parameters that represent files being uploaded by the user. |
FileBean |
getFileParameterValue(String name)
Returns a FileBean representing an uploaded file with the form field name = "name". |
Locale |
getLocale()
Provides access to the Locale being used to process the request. |
Enumeration<Locale> |
getLocales()
Returns a single element enumeration containing the selected Locale for this request. |
String |
getParameter(String name)
Retrieves the first value of the specified parameter from the request. |
net.sourceforge.stripes.controller.MergedParameterMap |
getParameterMap()
If the request is a clean URL, then extract the parameters from the URI and merge with the parameters from the query string and/or request body. |
Enumeration<String> |
getParameterNames()
Fetches just the names of regular parameters and does not include file upload parameters. |
String[] |
getParameterValues(String name)
Returns all values sent in the request for a given parameter name. |
boolean |
isMultipart()
Returns true if this request is wrapping a multipart request, false otherwise. |
void |
popUriParameters()
Restore the URI parameters to the state they were in before the previous call to pushUriParameters(HttpServletRequestWrapper) . |
void |
pushUriParameters(HttpServletRequestWrapper request)
Extract new URI parameters from the URI of the given request and merge them with the
previous URI parameters. |
protected void |
setLocale(Locale locale)
Used by the dispatcher to set the Locale chosen by the configured LocalePicker. |
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 |
Constructor Detail |
---|
public StripesRequestWrapper(HttpServletRequest request) throws StripesServletException
request
- the HttpServletRequest to wrap
this is not a file size limit, but a post size limit.
FileUploadLimitExceededException
- if the total post size is larger than the limit
StripesServletException
- if any other error occurs constructing the wrapperMethod Detail |
---|
public static StripesRequestWrapper findStripesWrapper(ServletRequest request)
request
- the ServletRequest that is wrapped by a StripesRequestWrapper
IllegalStateException
- if the request is not wrapped by Stripesprotected void constructMultipartWrapper(HttpServletRequest request) throws StripesServletException
request
- the HttpServletRequest to wrap
this is not a file size limit, but a post size limit.
StripesServletException
- if any other error occurs constructing the wrapperpublic boolean isMultipart()
public Enumeration<String> getParameterNames()
getParameterNames
in interface ServletRequest
getParameterNames
in class ServletRequestWrapper
public String[] getParameterValues(String name)
getParameterValues
in interface ServletRequest
getParameterValues
in class ServletRequestWrapper
public String getParameter(String name)
getParameter
in interface ServletRequest
getParameter
in class ServletRequestWrapper
public net.sourceforge.stripes.controller.MergedParameterMap getParameterMap()
getParameterMap
in interface ServletRequest
getParameterMap
in class ServletRequestWrapper
public void pushUriParameters(HttpServletRequestWrapper request)
request
and merge them with the
previous URI parameters.
public void popUriParameters()
pushUriParameters(HttpServletRequestWrapper)
.
public Locale getLocale()
getLocale
in interface ServletRequest
getLocale
in class ServletRequestWrapper
LocalePicker
public Enumeration<Locale> getLocales()
getLocales
in interface ServletRequest
getLocales
in class ServletRequestWrapper
LocalePicker
protected void setLocale(Locale locale)
public Enumeration<String> getFileParameterNames()
public FileBean getFileParameterValue(String name)
name
- the form field name of type file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |