Package com.aspectran.web.adapter
Class HttpServletRequestAdapter
- java.lang.Object
-
- com.aspectran.core.activity.request.AbstractRequest
-
- com.aspectran.core.adapter.AbstractRequestAdapter
-
- com.aspectran.web.adapter.HttpServletRequestAdapter
-
- All Implemented Interfaces:
RequestAdapter
public class HttpServletRequestAdapter extends AbstractRequestAdapter
AdaptHttpServletRequest
to CoreRequestAdapter
.- Since:
- 2011. 3. 13.
-
-
Field Summary
-
Fields inherited from class com.aspectran.core.adapter.AbstractRequestAdapter
adaptee
-
-
Constructor Summary
Constructors Constructor Description HttpServletRequestAdapter(MethodType requestMethod, javax.servlet.http.HttpServletRequest request)
Instantiates a new HttpServletRequestAdapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getBody()
<T extends Parameters>
TgetBodyAsParameters(java.lang.Class<T> requiredType)
java.lang.String
getEncoding()
Returns the name of the character encoding used in the body of this request.MultiValueMap<java.lang.String,java.lang.String>
getHeaderMap()
Returns a map of the request headers that can be modified.java.io.InputStream
getInputStream()
MediaType
getMediaType()
Gets the media type value included in the Content-Type header.void
preparse()
void
preparse(HttpServletRequestAdapter requestAdapter)
void
setEncoding(java.lang.String encoding)
Overrides the name of the character encoding used in the body of this request.-
Methods inherited from class com.aspectran.core.adapter.AbstractRequestAdapter
getAdaptee, getRequestScope, getRequestScope
-
Methods inherited from class com.aspectran.core.activity.request.AbstractRequest
addHeader, containsHeader, extractAttributes, extractParameters, getAllParameters, getAttribute, getAttributeMap, getAttributeNames, getBodyAsParameters, getFileParameter, getFileParameterMap, getFileParameterNames, getFileParameterValues, getHeader, getHeaderNames, getHeaderValues, getLocale, getMaxRequestSize, getParameter, getParameterMap, getParameterNames, getParameters, getParameters, getParameterValues, getRequestMethod, getTimeZone, hasAttributes, hasFileParameters, hasHeaders, hasParameters, putAllAttributes, putAllFileParameters, putAllParameters, putAllParameters, removeAttribute, removeFileParameter, setAttribute, setAttributeMap, setBody, setFileParameter, setFileParameter, setHeader, setHeaderMap, setLocale, setMaxRequestSize, setParameter, setParameter, setParameterMap, setTimeZone
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.aspectran.core.adapter.RequestAdapter
addHeader, containsHeader, extractAttributes, extractParameters, getAllParameters, getAttribute, getAttributeMap, getAttributeNames, getBodyAsParameters, getFileParameter, getFileParameterNames, getFileParameterValues, getHeader, getHeaderNames, getHeaderValues, getLocale, getMaxRequestSize, getParameter, getParameterMap, getParameterNames, getParameters, getParameters, getParameterValues, getRequestMethod, getTimeZone, hasAttributes, hasFileParameters, hasHeaders, hasParameters, putAllAttributes, putAllFileParameters, putAllParameters, putAllParameters, removeAttribute, removeFileParameter, setAttribute, setBody, setFileParameter, setFileParameter, setHeader, setLocale, setMaxRequestSize, setParameter, setParameter, setTimeZone
-
-
-
-
Constructor Detail
-
HttpServletRequestAdapter
public HttpServletRequestAdapter(MethodType requestMethod, javax.servlet.http.HttpServletRequest request)
Instantiates a new HttpServletRequestAdapter.- Parameters:
requestMethod
- the request methodrequest
- the activity request wrapper
-
-
Method Detail
-
getHeaderMap
public MultiValueMap<java.lang.String,java.lang.String> getHeaderMap()
Description copied from class:AbstractRequest
Returns a map of the request headers that can be modified. If not yet instantiated then create a new one.- Specified by:
getHeaderMap
in interfaceRequestAdapter
- Overrides:
getHeaderMap
in classAbstractRequest
- Returns:
- an
MultiValueMap
object, may not benull
-
getEncoding
public java.lang.String getEncoding()
Description copied from interface:RequestAdapter
Returns the name of the character encoding used in the body of this request.- Specified by:
getEncoding
in interfaceRequestAdapter
- Overrides:
getEncoding
in classAbstractRequest
- Returns:
- a
String
containing the name of the character encoding, ornull
if the request does not specify a character encoding
-
setEncoding
public void setEncoding(java.lang.String encoding) throws java.io.UnsupportedEncodingException
Description copied from interface:RequestAdapter
Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading request parameters or reading input using getReader(). Otherwise, it has no effect.- Specified by:
setEncoding
in interfaceRequestAdapter
- Overrides:
setEncoding
in classAbstractRequest
- Parameters:
encoding
- aString
containing the name of the character encoding.- Throws:
java.io.UnsupportedEncodingException
- if the specified encoding is invalid
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
- Specified by:
getInputStream
in interfaceRequestAdapter
- Overrides:
getInputStream
in classAbstractRequest
- Throws:
java.io.IOException
-
getBody
public java.lang.String getBody()
- Specified by:
getBody
in interfaceRequestAdapter
- Overrides:
getBody
in classAbstractRequest
-
getBodyAsParameters
public <T extends Parameters> T getBodyAsParameters(java.lang.Class<T> requiredType) throws RequestParseException
- Specified by:
getBodyAsParameters
in interfaceRequestAdapter
- Overrides:
getBodyAsParameters
in classAbstractRequest
- Throws:
RequestParseException
-
getMediaType
public MediaType getMediaType()
Gets the media type value included in the Content-Type header.
-
preparse
public void preparse()
-
preparse
public void preparse(HttpServletRequestAdapter requestAdapter)
-
-