org.appng.core.controller.filter

## Class EnvironmentFilter

- java.lang.Object
- - org.springframework.web.filter.GenericFilterBean
  - - org.springframework.web.filter.OncePerRequestFilter
    - - org.appng.core.controller.filter.EnvironmentFilter

- 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.core.env.EnvironmentCapable, org.springframework.web.context.ServletContextAware

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

  A `Filter` that creates a `DefaultEnvironment` for the current `HttpServletRequest`/ `HttpServletResponse` and adds it as an attribute to the current request.
  Additionally, it sets the attributes for the message diagnostic context (`MDC`).

- - ### 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
    `EnvironmentFilter()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain)`
    `static DefaultEnvironment` | `environment()` Retrieves the current `Environment` from the `RequestContextHolder`.
    `void` | `requestDestroyed(javax.servlet.http.HttpServletRequest httpServletRequest, Environment env)`
    `void` | `requestInitialized(javax.servlet.http.HttpServletRequest httpServletRequest, Environment env)`
    `protected void` | `setDiagnosticContext(Environment env, javax.servlet.http.HttpServletRequest httpServletRequest, Site site)`
    `protected void` | `setSecureFlag(javax.servlet.http.HttpServletRequest httpServletRequest, Site site)`

    - ### 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, createEnvironment, destroy, getEnvironment, 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

    - #### EnvironmentFilter

          public EnvironmentFilter()

  - ### Method Detail

    - #### doFilterInternal

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

      Specified by:
        `doFilterInternal` in class `org.springframework.web.filter.OncePerRequestFilter`
      Throws:
        `javax.servlet.ServletException`
        `IOException`

    - #### requestInitialized

          public void requestInitialized(javax.servlet.http.HttpServletRequest httpServletRequest,
                                         Environment env)

    - #### setDiagnosticContext

          protected void setDiagnosticContext(Environment env,
                                              javax.servlet.http.HttpServletRequest httpServletRequest,
                                              Site site)

    - #### setSecureFlag

          protected void setSecureFlag(javax.servlet.http.HttpServletRequest httpServletRequest,
                                       Site site)

    - #### requestDestroyed

          public void requestDestroyed(javax.servlet.http.HttpServletRequest httpServletRequest,
                                       Environment env)

    - #### environment

          public static DefaultEnvironment environment()

      Retrieves the current `Environment` from the `RequestContextHolder`.
      Returns:
        the environment

Copyright © 2011–2023 aiticon GmbH. All rights reserved.