public abstract class RequestContextHolder extends ObjectSE
RequestAttributes オブジェクトの形式で Web リクエストを公開するホルダークラス。inheritable フラグが true に設定されている場合、現在のスレッドによって生成されたすべての子スレッドによってリクエストが継承されます。 現在の Web リクエストを公開するには、RequestContextListener または RequestContextFilter を使用します。DispatcherServlet と DispatcherPortlet は、デフォルトで現在のリクエストをすでに公開していることに注意してください。
RequestContextListener, RequestContextFilter, DispatcherServlet, DispatcherPortlet| コンストラクターと説明 |
|---|
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, waitSEpublic static void resetRequestAttributes()
public static void setRequestAttributes(RequestAttributes attributes)
attributes - 公開する RequestAttributessetRequestAttributes(RequestAttributes, boolean)public static void setRequestAttributes(RequestAttributes attributes, boolean inheritable)
attributes - 公開する RequestAttributes、またはスレッドバインドコンテキストをリセットする null inheritable - RequestAttributes を子スレッドの継承可能として公開するかどうか (InheritableThreadLocalSE を使用する)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