public abstract class RequestContextHolder extends ObjectSE
RequestAttributes
オブジェクトの形式で Web リクエストを公開するホルダークラス。inheritable
フラグが true
に設定されている場合、現在のスレッドによって生成されたすべての子スレッドによってリクエストが継承されます。RequestContextListener
または RequestContextFilter
を使用して、現在の Web リクエストを公開します。DispatcherServlet
はデフォルトで現在のリクエストをすでに公開していることに注意してください。
RequestContextListener
, RequestContextFilter
, DispatcherServlet
コンストラクターと説明 |
---|
RequestContextHolder() |
修飾子と型 | メソッドと説明 |
---|---|
static RequestAttributes | currentRequestAttributes() 現在スレッドにバインドされている RequestAttributes を返します。 |
static RequestAttributes | getRequestAttributes() 現在スレッドにバインドされている RequestAttributes を返します。 |
static void | resetRequestAttributes() 現在のスレッドの RequestAttributes をリセットします。 |
static void | setRequestAttributes(RequestAttributes attributes) 指定された RequestAttributes を現在のスレッドにバインドし、子スレッドの継承可能として公開しません。 |
static void | setRequestAttributes(RequestAttributes attributes, boolean inheritable) 指定された RequestAttributes を現在のスレッドにバインドします。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public static void resetRequestAttributes()
public static void setRequestAttributes(@Nullable RequestAttributes attributes)
attributes
- 公開する RequestAttributessetRequestAttributes(RequestAttributes, boolean)
public static void setRequestAttributes(@Nullable RequestAttributes attributes, boolean inheritable)
attributes
- 公開する RequestAttributes、またはスレッドバインドコンテキストをリセットする null
inheritable
- RequestAttributes を子スレッドの継承可能として公開するかどうか (InheritableThreadLocal
SE を使用する)@Nullable public static RequestAttributes getRequestAttributes()
null
public static RequestAttributes currentRequestAttributes() throws IllegalStateExceptionSE
以前にバインドされた RequestAttributes インスタンスがあれば、それを公開します。存在する場合、現在の JSF FacesContext にフォールバックします。
IllegalStateExceptionSE
- RequestAttributes オブジェクトが現在のスレッドにバインドされていない場合 setRequestAttributes(org.springframework.web.context.request.RequestAttributes)
, ServletRequestAttributes
, FacesRequestAttributes
, FacesContext.getCurrentInstance()
EE