Package oracle.i18n.servlet.filter
Class ServletRequestWrapper
- java.lang.Object
-
- javax.servlet.ServletRequestWrapper
-
- javax.servlet.http.HttpServletRequestWrapper
-
- oracle.i18n.servlet.filter.ServletRequestWrapper
-
- All Implemented Interfaces:
javax.servlet.http.HttpServletRequest,javax.servlet.ServletRequest
public class ServletRequestWrapper extends javax.servlet.http.HttpServletRequestWrapperTheServletRequestWrapperclass is an HTTP request class that detects the current user locale and makes it available for the application.- Since:
- 10.1.0.2
-
-
Constructor Summary
Constructors Constructor Description ServletRequestWrapper(javax.servlet.http.HttpServletRequest request)Constructs a ServletRequestWrapper object for the GDK framework.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCharacterEncoding()Returns the name of the character encoding used in the body of this request, or returnsnullif the request does not specify character encoding.LocalegetLocale()Returns the current locale derived from the locale detection mechanism.EnumerationgetLocales()Returns theEnumerationobject that includes the current locales derived from the locale detection mechanism.StringgetParameter(String key)Returns the parameter value corresponding to the key.MapgetParameterMap()Returns ajava.util.Mapobject of the parameters of this request.EnumerationgetParameterNames()Returns anEnumerationofStringobjects containing the names of the parameters in this request.String[]getParameterValues(String key)Returns an array ofStringobjects containing all the values of the given request parameter, or returnsnullif the parameter does not exist.StringgetRawParameter(String key)Returns the raw value of the parameter corresponding to the key.voidsetCharacterEncoding(String env)Sets the character set of the input stream.-
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
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
-
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getContentLength, getContentType, getInputStream, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, 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, getContentLength, getContentType, getInputStream, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute
-
-
-
-
Constructor Detail
-
ServletRequestWrapper
public ServletRequestWrapper(javax.servlet.http.HttpServletRequest request) throws IOExceptionConstructs a ServletRequestWrapper object for the GDK framework.- Parameters:
request- a defaultHttpServletRequestobject- Throws:
IOException- if I/O exception occurs
-
-
Method Detail
-
getLocale
public Locale getLocale()
Returns the current locale derived from the locale detection mechanism.- Specified by:
getLocalein interfacejavax.servlet.ServletRequest- Overrides:
getLocalein classjavax.servlet.ServletRequestWrapper- Returns:
Localeobject
-
getLocales
public Enumeration getLocales()
Returns theEnumerationobject that includes the current locales derived from the locale detection mechanism.- Specified by:
getLocalesin interfacejavax.servlet.ServletRequest- Overrides:
getLocalesin classjavax.servlet.ServletRequestWrapper- Returns:
Enumerationobject
-
getCharacterEncoding
public String getCharacterEncoding()
Returns the name of the character encoding used in the body of this request, or returnsnullif the request does not specify character encoding.- Specified by:
getCharacterEncodingin interfacejavax.servlet.ServletRequest- Overrides:
getCharacterEncodingin classjavax.servlet.ServletRequestWrapper- Returns:
- a
Stringcontaining the name of the character encoding, or returnsnullif the request does not specify character encoding
-
getRawParameter
public String getRawParameter(String key)
Returns the raw value of the parameter corresponding to the key. This method does not perform character set conversion on the returned parameter.- Parameters:
key- the key string- Returns:
- a
Stringvalue corresponding to thekey
-
getParameter
public String getParameter(String key)
Returns the parameter value corresponding to the key.- Specified by:
getParameterin interfacejavax.servlet.ServletRequest- Overrides:
getParameterin classjavax.servlet.ServletRequestWrapper- Parameters:
key- the key string- Returns:
- a
Stringvalue corresponding to thekey
-
getParameterValues
public String[] getParameterValues(String key)
Returns an array ofStringobjects containing all the values of the given request parameter, or returnsnullif the parameter does not exist.- Specified by:
getParameterValuesin interfacejavax.servlet.ServletRequest- Overrides:
getParameterValuesin classjavax.servlet.ServletRequestWrapper- Parameters:
key- a parameter name- Returns:
- an array of
Stringobjects containing the parameter values corresponding to thekey
-
getParameterMap
public Map getParameterMap()
Returns ajava.util.Mapobject of the parameters of this request. For HTTP servlets, parameters are contained in the query string or posted form data.- Specified by:
getParameterMapin interfacejavax.servlet.ServletRequest- Overrides:
getParameterMapin classjavax.servlet.ServletRequestWrapper- Returns:
- a
java.util.Mapobject containing parameter names as keys and parameter values as map values
-
getParameterNames
public Enumeration getParameterNames()
Returns anEnumerationofStringobjects containing the names of the parameters in this request. If the request has no parameters, the method returns an emptyEnumerationobject.- Specified by:
getParameterNamesin interfacejavax.servlet.ServletRequest- Overrides:
getParameterNamesin classjavax.servlet.ServletRequestWrapper- Returns:
- a
java.util.Enumerationobject containing parameter names
-
setCharacterEncoding
public void setCharacterEncoding(String env) throws UnsupportedEncodingException
Sets the character set of the input stream. By default, GDK determines the input character set based on the application configuration file. Use this method only if it is necessary to explicitly specify the character set.- Specified by:
setCharacterEncodingin interfacejavax.servlet.ServletRequest- Overrides:
setCharacterEncodingin classjavax.servlet.ServletRequestWrapper- Parameters:
env- an IANA character set name- Throws:
UnsupportedEncodingException- if the given character set name is invalid
-
-