com.gisgraphy.webapp.filter

## Class LocaleFilter

- java.lang.Object
- - org.springframework.web.filter.GenericFilterBean
  - - org.springframework.web.filter.OncePerRequestFilter
    - - com.gisgraphy.webapp.filter.LocaleFilter

- All Implemented Interfaces:
    javax.servlet.Filter, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.EnvironmentAware, org.springframework.web.context.ServletContextAware

      public class LocaleFilter
      extends org.springframework.web.filter.OncePerRequestFilter

  Filter to wrap request with a request including user preferred locale.

- - ### Field Summary

    - ### Fields inherited from class org.springframework.web.filter.OncePerRequestFilter

      `ALREADY_FILTERED_SUFFIX`

    - ### Fields inherited from class org.springframework.web.filter.GenericFilterBean

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocaleFilter()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain)` This method looks for a "locale" request parameter.

    - ### Methods inherited from class org.springframework.web.filter.OncePerRequestFilter

      `doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch`

    - ### Methods inherited from class org.springframework.web.filter.GenericFilterBean

      `addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LocaleFilter

          public LocaleFilter()

  - ### Method Detail

    - #### doFilterInternal

          public void doFilterInternal(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response,
                              javax.servlet.FilterChain chain)
                                throws IOException,
                                       javax.servlet.ServletException

      This method looks for a "locale" request parameter. If it finds one, it sets it as the preferred locale and also configures it to work with JSTL.
      Specified by:
        `doFilterInternal` in class `org.springframework.web.filter.OncePerRequestFilter`
      Parameters:
        `request` - the current request
        `response` - the current response
        `chain` - the chain
      Throws:
        `IOException` - when something goes wrong
        `javax.servlet.ServletException` - when a communication failure happens

Copyright © 2015. All rights reserved.