org.springframework.web.util
Class RequestHolder

java.lang.Object
  extended by org.springframework.web.util.RequestHolder

public abstract class RequestHolder
extends Object

Class to manage thread-bound HttpServletRequest.

Since:
1.3
Author:
Rod Johnson

Field Summary
static ThreadLocal currentRequest
          Holder for the current request.
 
Constructor Summary
RequestHolder()
           
 
Method Summary
static void bind(HttpServletRequest request)
           
static void clear()
          Clear any request bound to the thread.
static HttpServletRequest currentRequest()
          Return the request currently bound to the thread.
static HttpSession currentSession()
          Convenient method to return the session associated with the current request, creating one if none exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentRequest

public static ThreadLocal currentRequest
Holder for the current request.

Constructor Detail

RequestHolder

public RequestHolder()
Method Detail

bind

public static void bind(HttpServletRequest request)

clear

public static void clear()
Clear any request bound to the thread.


currentRequest

public static HttpServletRequest currentRequest()
                                         throws IllegalStateException
Return the request currently bound to the thread.

Returns:
the request currently bound to the thread
Throws:
IllegalStateException - if no request is bound to the current thread

currentSession

public static HttpSession currentSession()
Convenient method to return the session associated with the current request, creating one if none exists.

Returns:
the Session to which the current request belongs.


Copyright (c) 2002-2005 The Spring Framework Project.