public class ServletRequestWrapper extends HttpServletRequestWrapper
ServletRequestWrapper
class is an HTTP request class that detects the current user locale and makes it available for the application.BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
Constructor and Description |
---|
ServletRequestWrapper(HttpServletRequest request)
Constructs a ServletRequestWrapper object for the GDK framework.
|
Modifier and Type | Method and Description |
---|---|
String |
getCharacterEncoding()
Returns the name of the character encoding used in the body of this request, or returns
null if the request does not specify character encoding. |
Locale |
getLocale()
Returns the current locale derived from the locale detection mechanism.
|
Enumeration |
getLocales()
Returns the
Enumeration object that includes the current locales derived from the locale detection mechanism. |
String |
getParameter(String key)
Returns the parameter value corresponding to the key.
|
Map |
getParameterMap()
Returns a
java.util.Map object of the parameters of this request. |
Enumeration |
getParameterNames()
Returns an
Enumeration of String objects containing the names of the parameters in this request. |
String[] |
getParameterValues(String key)
Returns an array of
String objects containing all the values of the given request parameter, or returns null if the parameter does not exist. |
String |
getRawParameter(String key)
Returns the raw value of the parameter corresponding to the key.
|
void |
setCharacterEncoding(String env)
Sets the character set of the input stream.
|
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
getAttribute, getAttributeNames, getContentLength, getContentType, getInputStream, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setRequest
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAttribute, getAttributeNames, getContentLength, getContentType, getInputStream, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute
public ServletRequestWrapper(HttpServletRequest request) throws IOException
request
- a default HttpServletRequest
objectIOException
- if I/O exception occurspublic Locale getLocale()
getLocale
in interface ServletRequest
getLocale
in class ServletRequestWrapper
Locale
objectpublic Enumeration getLocales()
Enumeration
object that includes the current locales derived from the locale detection mechanism.getLocales
in interface ServletRequest
getLocales
in class ServletRequestWrapper
Enumeration
objectpublic String getCharacterEncoding()
null
if the request does not specify character encoding.getCharacterEncoding
in interface ServletRequest
getCharacterEncoding
in class ServletRequestWrapper
String
containing the name of the character encoding, or returns null
if the request does not specify character encodingpublic String getRawParameter(String key)
key
- the key stringString
value corresponding to the key
public String getParameter(String key)
getParameter
in interface ServletRequest
getParameter
in class ServletRequestWrapper
key
- the key stringString
value corresponding to the key
public String[] getParameterValues(String key)
String
objects containing all the values of the given request parameter, or returns null
if the parameter does not exist.getParameterValues
in interface ServletRequest
getParameterValues
in class ServletRequestWrapper
key
- a parameter nameString
objects containing the parameter values corresponding to the key
public Map getParameterMap()
java.util.Map
object of the parameters of this request. For HTTP servlets, parameters are contained in the query string or posted form data.getParameterMap
in interface ServletRequest
getParameterMap
in class ServletRequestWrapper
java.util.Map
object containing parameter names as keys and parameter values as map valuespublic Enumeration getParameterNames()
Enumeration
of String
objects containing the names of the parameters in this request. If the request has no parameters, the method returns an empty Enumeration
object.getParameterNames
in interface ServletRequest
getParameterNames
in class ServletRequestWrapper
java.util.Enumeration
object containing parameter namespublic void setCharacterEncoding(String env) throws UnsupportedEncodingException
setCharacterEncoding
in interface ServletRequest
setCharacterEncoding
in class ServletRequestWrapper
env
- an IANA character set nameUnsupportedEncodingException
- if the given character set name is invalid