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
AdaptHttpServletRequestto 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.StringgetBody()<T extends Parameters>
TgetBodyAsParameters(java.lang.Class<T> requiredType)java.lang.StringgetEncoding()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.InputStreamgetInputStream()MediaTypegetMediaType()Gets the media type value included in the Content-Type header.voidpreparse()voidpreparse(HttpServletRequestAdapter requestAdapter)voidsetEncoding(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:AbstractRequestReturns a map of the request headers that can be modified. If not yet instantiated then create a new one.- Specified by:
getHeaderMapin interfaceRequestAdapter- Overrides:
getHeaderMapin classAbstractRequest- Returns:
- an
MultiValueMapobject, may not benull
-
getEncoding
public java.lang.String getEncoding()
Description copied from interface:RequestAdapterReturns the name of the character encoding used in the body of this request.- Specified by:
getEncodingin interfaceRequestAdapter- Overrides:
getEncodingin classAbstractRequest- Returns:
- a
Stringcontaining the name of the character encoding, ornullif the request does not specify a character encoding
-
setEncoding
public void setEncoding(java.lang.String encoding) throws java.io.UnsupportedEncodingExceptionDescription copied from interface:RequestAdapterOverrides 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:
setEncodingin interfaceRequestAdapter- Overrides:
setEncodingin classAbstractRequest- Parameters:
encoding- aStringcontaining 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:
getInputStreamin interfaceRequestAdapter- Overrides:
getInputStreamin classAbstractRequest- Throws:
java.io.IOException
-
getBody
public java.lang.String getBody()
- Specified by:
getBodyin interfaceRequestAdapter- Overrides:
getBodyin classAbstractRequest
-
getBodyAsParameters
public <T extends Parameters> T getBodyAsParameters(java.lang.Class<T> requiredType) throws RequestParseException
- Specified by:
getBodyAsParametersin interfaceRequestAdapter- Overrides:
getBodyAsParametersin 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)
-
-