org.springframework.web.context.request

Class RequestContextHolder

  • java.lang.Object
    • org.springframework.web.context.request.RequestContextHolder
    • Constructor Detail

      • RequestContextHolder

        public RequestContextHolder()
    • Method Detail

      • resetRequestAttributes

        public static void resetRequestAttributes()
        Reset the RequestAttributes for the current thread.
      • setRequestAttributes

        public static void setRequestAttributes(@Nullable
                                                RequestAttributes attributes,
                                                boolean inheritable)
        Bind the given RequestAttributes to the current thread.
        Parameters:
        attributes - the RequestAttributes to expose, or null to reset the thread-bound context
        inheritable - whether to expose the RequestAttributes as inheritable for child threads (using an InheritableThreadLocal)
      • getRequestAttributes

        @Nullable
        public static RequestAttributes getRequestAttributes()
        Return the RequestAttributes currently bound to the thread.
        Returns:
        the RequestAttributes currently bound to the thread, or null if none bound