类 ForwardedHeaderFilter

    • 方法详细资料

      • setRemoveOnly

        public void setRemoveOnly​(boolean removeOnly)
        Enables mode in which any "Forwarded" or "X-Forwarded-*" headers are removed only and the information in them ignored.
        参数:
        removeOnly - whether to discard and ignore forwarded headers
        从以下版本开始:
        4.3.9
      • setRelativeRedirects

        public void setRelativeRedirects​(boolean relativeRedirects)
        Use this property to enable relative redirects as explained in RelativeRedirectFilter, and also using the same response wrapper as that filter does, or if both are configured, only one will wrap.

        By default, if this property is set to false, in which case calls to HttpServletResponse.sendRedirect(String) are overridden in order to turn relative into absolute URLs, also taking into account forwarded headers.

        参数:
        relativeRedirects - whether to use relative redirects
        从以下版本开始:
        4.3.10
      • shouldNotFilterAsyncDispatch

        protected boolean shouldNotFilterAsyncDispatch()
        从类复制的说明: OncePerRequestFilter
        The dispatcher type javax.servlet.DispatcherType.ASYNC introduced in Servlet 3.0 means a filter can be invoked in more than one thread over the course of a single request. Some filters only need to filter the initial thread (e.g. request wrapping) while others may need to be invoked at least once in each additional thread for example for setting up thread locals or to perform final processing at the very end.

        Note that although a filter can be mapped to handle specific dispatcher types via web.xml or in Java through the ServletContext, servlet containers may enforce different defaults with regards to dispatcher types. This flag enforces the design intent of the filter.

        The default return value is "true", which means the filter will not be invoked during subsequent async dispatches. If "false", the filter will be invoked during async dispatches with the same guarantees of being invoked only once during a request within a single thread.

        覆盖:
        shouldNotFilterAsyncDispatch 在类中 OncePerRequestFilter