クラス MockPageContext
java.lang.ObjectSE
jakarta.servlet.jsp.JspContext
jakarta.servlet.jsp.PageContext
org.springframework.mock.web.MockPageContext
PageContextEE インターフェースのモック実装。カスタム JSP タグをテストするときにアプリケーションをテストする場合にのみ必要です。 メモ: PageContext.initialize メソッドではなく、コンストラクターによる初期化が必要です。JspWriter への書き込み、リクエストのディスパッチ、handlePageException 呼び出しはサポートしていません。
- 導入:
- 1.0.2
- 作成者:
- Juergen Hoeller
フィールドのサマリー
クラス jakarta.servlet.jsp.PageContextEE から継承されたフィールド
APPLICATIONEE, APPLICATION_SCOPEEE, CONFIGEE, EXCEPTIONEE, OUTEE, PAGEEE, PAGE_SCOPEEE, PAGECONTEXTEE, REQUESTEE, REQUEST_SCOPEEE, RESPONSEEE, SESSIONEE, SESSION_SCOPEEEコンストラクターの概要
コンストラクターコンストラクター説明デフォルトのMockServletContext、MockHttpServletRequest、MockHttpServletResponse、MockServletConfigで新しい MockPageContext を作成します。MockPageContext(ServletContextEE servletContext) デフォルトのMockHttpServletRequest、MockHttpServletResponse、MockServletConfigで新しい MockPageContext を作成します。MockPageContext(ServletContextEE servletContext, HttpServletRequestEE request) MockHttpServletResponse、MockServletConfig を使用して新しい MockPageContext を作成します。MockPageContext(ServletContextEE servletContext, HttpServletRequestEE request, HttpServletResponseEE response) MockServletConfig を使用して新しい MockPageContext を作成します。MockPageContext(ServletContextEE servletContext, HttpServletRequestEE request, HttpServletResponseEE response, ServletConfigEE servletConfig) 新しい MockServletConfig を作成します。メソッドのサマリー
修飾子と型メソッド説明findAttribute(StringSE name) voidgetAttribute(StringSE name) getAttribute(StringSE name, int scope) getAttributeNamesInScope(int scope) intgetAttributesScope(StringSE name) byte[]使用すべきではありません。getOut()getPage()使用すべきではありません。voidvoidvoidvoidvoidinitialize(ServletEE servlet, ServletRequestEE request, ServletResponseEE response, StringSE errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) voidrelease()voidremoveAttribute(StringSE name) voidremoveAttribute(StringSE name, int scope) voidsetAttribute(StringSE name, ObjectSE value) voidsetAttribute(StringSE name, ObjectSE value, int scope) クラス jakarta.servlet.jsp.PageContextEE から継承されたメソッド
getErrorData, pushBodyクラス jakarta.servlet.jsp.JspContextEE から継承されたメソッド
popBody, pushBodyEE
コンストラクターの詳細
MockPageContext
public MockPageContext()デフォルトのMockServletContext、MockHttpServletRequest、MockHttpServletResponse、MockServletConfigで新しい MockPageContext を作成します。MockPageContext
デフォルトのMockHttpServletRequest、MockHttpServletResponse、MockServletConfigで新しい MockPageContext を作成します。- パラメーター:
servletContext- JSP ページが実行される ServletContext (実際に ServletContext にアクセスする場合にのみ必要)
MockPageContext
public MockPageContext(@Nullable ServletContextEE servletContext, @Nullable HttpServletRequestEE request) MockHttpServletResponse、MockServletConfig を使用して新しい MockPageContext を作成します。- パラメーター:
servletContext- JSP ページが実行される ServletContextrequest- 現在の HttpServletRequest (実際にリクエストにアクセスする場合にのみ必要)
MockPageContext
public MockPageContext(@Nullable ServletContextEE servletContext, @Nullable HttpServletRequestEE request, @Nullable HttpServletResponseEE response) MockServletConfig を使用して新しい MockPageContext を作成します。- パラメーター:
servletContext- JSP ページが実行される ServletContextrequest- 現在の HttpServletRequestresponse- 現在の HttpServletResponse (実際にレスポンスに書き込む場合にのみ必要)
MockPageContext
public MockPageContext(@Nullable ServletContextEE servletContext, @Nullable HttpServletRequestEE request, @Nullable HttpServletResponseEE response, @Nullable ServletConfigEE servletConfig) 新しい MockServletConfig を作成します。- パラメーター:
servletContext- JSP ページが実行される ServletContextrequest- 現在の HttpServletRequestresponse- 現在の HttpServletResponseservletConfig- ServletConfig (タグ内からアクセスされることはほとんどありません)
メソッドの詳細
initialize
public void initialize(ServletEE servlet, ServletRequestEE request, ServletResponseEE response, StringSE errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) - 次で指定:
- クラス
PageContextEEのinitializeEE
release
public void release()- 次で指定:
- クラス
PageContextEEのrelease
setAttribute
- 次で指定:
- クラス
JspContextEEのsetAttributeEE
setAttribute
- 次で指定:
- クラス
JspContextEEのsetAttributeEE
getAttribute
- 次で指定:
- クラス
JspContextEEのgetAttributeEE
getAttribute
- 次で指定:
- クラス
JspContextEEのgetAttributeEE
findAttribute
- 次で指定:
- クラス
JspContextEEのfindAttributeEE
removeAttribute
- 次で指定:
- クラス
JspContextEEのremoveAttributeEE
removeAttribute
- 次で指定:
- クラス
JspContextEEのremoveAttributeEE
getAttributesScope
- 次で指定:
- クラス
JspContextEEのgetAttributesScopeEE
getAttributeNames
getAttributeNamesInScope
- 次で指定:
- クラス
JspContextEEのgetAttributeNamesInScopeEE
getOut
- 次で指定:
- クラス
JspContextEEのgetOut
getExpressionEvaluator
使用すべきではありません。- 次で指定:
- クラス
JspContextEEのgetExpressionEvaluator
getELContext
- 次で指定:
- クラス
JspContextEEのgetELContext
getVariableResolver
使用すべきではありません。- 次で指定:
- クラス
JspContextEEのgetVariableResolver
getSession
- 次で指定:
- クラス
PageContextEEのgetSession
getPage
- 次で指定:
- クラス
PageContextEEのgetPage
getRequest
- 次で指定:
- クラス
PageContextEEのgetRequest
getResponse
- 次で指定:
- クラス
PageContextEEのgetResponse
getException
- 次で指定:
- クラス
PageContextEEのgetException
getServletConfig
- 次で指定:
- クラス
PageContextEEのgetServletConfig
getServletContext
- 次で指定:
- クラス
PageContextEEのgetServletContext
forward
- 次で指定:
- クラス
PageContextEEのforwardEE - 例外:
ServletExceptionEEIOExceptionSE
include
- 次で指定:
- クラス
PageContextEEのincludeEE - 例外:
ServletExceptionEEIOExceptionSE
include
- 次で指定:
- クラス
PageContextEEのincludeEE - 例外:
ServletExceptionEEIOExceptionSE
getContentAsByteArray
public byte[] getContentAsByteArray()getContentAsString
handlePageException
- 次で指定:
- クラス
PageContextEEのhandlePageExceptionEE - 例外:
ServletExceptionEEIOExceptionSE
handlePageException
- 次で指定:
- クラス
PageContextEEのhandlePageExceptionEE - 例外:
ServletExceptionEEIOExceptionSE