public class HttpServletRequestAdapter extends AbstractRequestAdapter
adaptee
Constructor and Description |
---|
HttpServletRequestAdapter(javax.servlet.http.HttpServletRequest request)
Instantiates a new HttpServletRequestAdapter.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
getAttribute(String name)
Returns the value of the named attribute as a given type,
or
null if no attribute of the given name exists. |
Enumeration<String> |
getAttributeNames()
Returns an
Enumeration containing the
names of the attributes available to this request. |
String |
getCharacterEncoding()
Returns the name of the character encoding used in the body of this request.
|
Locale |
getLocale()
Returns the preferred
Locale . |
void |
removeAttribute(String name)
Removes an attribute from this request.
|
void |
setAttribute(String name,
Object o)
Stores an attribute in this request.
|
void |
setCharacterEncoding(String characterEncoding)
Overrides the name of the character encoding used in the body of this request.
|
protected MultiValueMap<String,String> |
touchHeaders()
Returns a map of the request headers that can be modified.
|
getAdaptee, getRequestScope, getRequestScope, setRequestScope
addHeader, containsHeader, fillAttributeMap, fillPrameterMap, getAttributeMap, getFileParameter, getFileParameterNames, getFileParameterValues, getHeader, getHeaderNames, getHeaders, getHeaders, getParameter, getParameterMap, getParameterNames, getParameterValues, getRequestMethod, getTimeZone, isHeadersInstantiated, isMaxLengthExceeded, removeFileParameter, setFileParameter, setFileParameter, setHeader, setLocale, setMaxLengthExceeded, setParameter, setParameter, setRequestMethod, setTimeZone
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addHeader, containsHeader, fillAttributeMap, fillPrameterMap, getAttributeMap, getFileParameter, getFileParameterNames, getFileParameterValues, getHeader, getHeaderNames, getHeaders, getHeaders, getParameter, getParameterMap, getParameterNames, getParameterValues, getRequestMethod, getTimeZone, isMaxLengthExceeded, removeFileParameter, setFileParameter, setFileParameter, setHeader, setLocale, setMaxLengthExceeded, setParameter, setParameter, setTimeZone
public HttpServletRequestAdapter(javax.servlet.http.HttpServletRequest request)
request
- the HTTP requestpublic String getCharacterEncoding()
RequestAdapter
String
containing the name of the character encoding,
or null
if the request does not specify a character encodingpublic void setCharacterEncoding(String characterEncoding) throws UnsupportedEncodingException
RequestAdapter
characterEncoding
- a String
containing the name of the character encoding.UnsupportedEncodingException
- if the specified encoding is invalidprotected MultiValueMap<String,String> touchHeaders()
AbstractAdaptiveRequest
touchHeaders
in class AbstractAdaptiveRequest
MultiValueMap
object, may not be null
public <T> T getAttribute(String name)
RequestAdapter
null
if no attribute of the given name exists.getAttribute
in interface RequestAdapter
getAttribute
in class AbstractAdaptiveRequest
T
- the generic typename
- a String
specifying the name of the attributeObject
containing the value of the attribute,
or null
if the attribute does not existpublic void setAttribute(String name, Object o)
RequestAdapter
setAttribute
in interface RequestAdapter
setAttribute
in class AbstractAdaptiveRequest
name
- specifying the name of the attributeo
- the Object
to be storedpublic Enumeration<String> getAttributeNames()
RequestAdapter
Enumeration
containing the
names of the attributes available to this request.
This method returns an empty Enumeration
if the request has no attributes available to it.getAttributeNames
in interface RequestAdapter
getAttributeNames
in class AbstractAdaptiveRequest
public void removeAttribute(String name)
RequestAdapter
name
- a String
specifying the name of the attribute to removepublic Locale getLocale()
RequestAdapter
Locale
.getLocale
in interface RequestAdapter
getLocale
in class AbstractAdaptiveRequest
Locale
Copyright © 2008–2017 Aspectran.com. All rights reserved.