com.gisgraphy.webapp.filter

## Class LocaleRequestWrapper

- java.lang.Object
- - javax.servlet.ServletRequestWrapper
  - - javax.servlet.http.HttpServletRequestWrapper
    - - com.gisgraphy.webapp.filter.LocaleRequestWrapper

- All Implemented Interfaces:
    javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

      public class LocaleRequestWrapper
      extends javax.servlet.http.HttpServletRequestWrapper

  HttpRequestWrapper overriding methods getLocale(), getLocales() to include the user's preferred locale.

- - ### Field Summary

    - ### Fields inherited from interface javax.servlet.http.HttpServletRequest

      `BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocaleRequestWrapper(javax.servlet.http.HttpServletRequest decorated, Locale userLocale)` Sets preferred local to user's locale

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Locale` | `getLocale()`
    `Enumeration<Locale>` | `getLocales()`

    - ### 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, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, 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, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding`

- - ### Constructor Detail

    - #### LocaleRequestWrapper

          public LocaleRequestWrapper(javax.servlet.http.HttpServletRequest decorated,
                              Locale userLocale)

      Sets preferred local to user's locale
      Parameters:
        `decorated` - the current decorated request
        `userLocale` - the user's locale

  - ### Method Detail

    - #### getLocale

          public Locale getLocale()

      Specified by:
        `getLocale` in interface `javax.servlet.ServletRequest`
      Overrides:
        `getLocale` in class `javax.servlet.ServletRequestWrapper`

    - #### getLocales

          public Enumeration<Locale> getLocales()

      Specified by:
        `getLocales` in interface `javax.servlet.ServletRequest`
      Overrides:
        `getLocales` in class `javax.servlet.ServletRequestWrapper`

Copyright © 2015. All rights reserved.