Class HttpServletRequestHolder

java.lang.Object
org.togglz.servlet.util.HttpServletRequestHolder

public class HttpServletRequestHolder extends Object
This class can be used to bind the HttpServletRequest to a thread local. Please take special care to ALWAYS remove the request from the thread local by calling release().
Author:
Christian Kaltepoth
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    bind(jakarta.servlet.http.HttpServletRequest request)
    Associate the request with the current thread.
    static jakarta.servlet.http.HttpServletRequest
    get()
     
    static void
    Remove the request that is currently associated with the current thread.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HttpServletRequestHolder

      public HttpServletRequestHolder()
  • Method Details

    • bind

      public static void bind(jakarta.servlet.http.HttpServletRequest request)
      Associate the request with the current thread.
    • release

      public static void release()
      Remove the request that is currently associated with the current thread.
    • get

      public static jakarta.servlet.http.HttpServletRequest get()