org.springframework.web.context.request

Class RequestContextHolder

    • Field Detail

      • jsfPresent

        private static final boolean jsfPresent
      • requestAttributesHolder

        private static final java.lang.ThreadLocal<RequestAttributes> requestAttributesHolder
      • inheritableRequestAttributesHolder

        private static final java.lang.ThreadLocal<RequestAttributes> inheritableRequestAttributesHolder
    • Constructor Detail

      • RequestContextHolder

        public RequestContextHolder()
    • Method Detail

      • resetRequestAttributes

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

        public static void setRequestAttributes(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

        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