public class MockPageContext extends PageContextEE
PageContextEE インターフェースのモック実装。カスタム JSP タグをテストするときにアプリケーションをテストする場合にのみ必要です。 メモ: PageContext.initialize メソッドではなく、コンストラクターによる初期化が必要です。JspWriter への書き込み、リクエストのディスパッチ、handlePageException 呼び出しはサポートしていません。
APPLICATIONEE, APPLICATION_SCOPEEE, CONFIGEE, EXCEPTIONEE, OUTEE, PAGEEE, PAGE_SCOPEEE, PAGECONTEXTEE, REQUESTEE, REQUEST_SCOPEEE, RESPONSEEE, SESSIONEE, SESSION_SCOPEEE| コンストラクターと説明 |
|---|
MockPageContext() デフォルトの 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 を作成します。 |
getErrorDataEE, pushBodyEEpopBodyEE, pushBodyEEcloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic MockPageContext()
MockServletContext、MockHttpServletRequest、MockHttpServletResponse、MockServletConfig で新しい MockPageContext を作成します。public MockPageContext(@Nullable ServletContextEE servletContext)
MockHttpServletRequest、MockHttpServletResponse、MockServletConfig で新しい MockPageContext を作成します。servletContext - JSP ページが実行される ServletContext (実際に ServletContext にアクセスする場合にのみ必要)public MockPageContext(@Nullable ServletContextEE servletContext, @Nullable HttpServletRequestEE request)
servletContext - JSP ページが実行される ServletContextrequest - 現在の HttpServletRequest (実際にリクエストにアクセスする場合にのみ必要)public MockPageContext(@Nullable ServletContextEE servletContext, @Nullable HttpServletRequestEE request, @Nullable HttpServletResponseEE response)
servletContext - JSP ページが実行される ServletContextrequest - 現在の HttpServletRequestresponse - 現在の HttpServletResponse (実際にレスポンスに書き込む場合にのみ必要)public MockPageContext(@Nullable ServletContextEE servletContext, @Nullable HttpServletRequestEE request, @Nullable HttpServletResponseEE response, @Nullable ServletConfigEE servletConfig)
servletContext - JSP ページが実行される ServletContextrequest - 現在の HttpServletRequestresponse - 現在の HttpServletResponseservletConfig - ServletConfig (タグ内からアクセスされることはほとんどありません)public void initialize(ServletEE servlet, ServletRequestEE request, ServletResponseEE response, StringSE errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush)
PageContextEE の initializeEE public void release()
PageContextEE の releaseEE public void setAttribute(StringSE name, @Nullable ObjectSE value)
JspContextEE の setAttributeEE public void setAttribute(StringSE name, @Nullable ObjectSE value, int scope)
JspContextEE の setAttributeEE @Nullable public ObjectSE getAttribute(StringSE name)
JspContextEE の getAttributeEE @Nullable public ObjectSE getAttribute(StringSE name, int scope)
JspContextEE の getAttributeEE @Nullable public ObjectSE findAttribute(StringSE name)
JspContextEE の findAttributeEE public void removeAttribute(StringSE name)
JspContextEE の removeAttributeEE public void removeAttribute(StringSE name, int scope)
JspContextEE の removeAttributeEE public int getAttributesScope(StringSE name)
JspContextEE の getAttributesScopeEE public EnumerationSE<StringSE> getAttributeNames()
public EnumerationSE<StringSE> getAttributeNamesInScope(int scope)
JspContextEE の getAttributeNamesInScopeEE public JspWriterEE getOut()
JspContextEE の getOutEE @DeprecatedSE public ExpressionEvaluatorEE getExpressionEvaluator()
JspContextEE の getExpressionEvaluatorEE @Nullable public ELContextEE getELContext()
JspContextEE の getELContextEE @DeprecatedSE @Nullable public VariableResolverEE getVariableResolver()
JspContextEE の getVariableResolverEE public HttpSessionEE getSession()
PageContextEE の getSessionEE public ObjectSE getPage()
PageContextEE の getPageEE public ServletRequestEE getRequest()
PageContextEE の getRequestEE public ServletResponseEE getResponse()
PageContextEE の getResponseEE @Nullable public ExceptionSE getException()
PageContextEE の getExceptionEE public ServletConfigEE getServletConfig()
PageContextEE の getServletConfigEE public ServletContextEE getServletContext()
PageContextEE の getServletContextEE public void forward(StringSE path) throws ServletExceptionEE, IOExceptionSE
PageContextEE の forwardEE ServletExceptionEEIOExceptionSEpublic void include(StringSE path) throws ServletExceptionEE, IOExceptionSE
PageContextEE の includeEE ServletExceptionEEIOExceptionSEpublic void include(StringSE path, boolean flush) throws ServletExceptionEE, IOExceptionSE
PageContextEE の includeEE ServletExceptionEEIOExceptionSEpublic byte[] getContentAsByteArray()
public StringSE getContentAsString() throws UnsupportedEncodingExceptionSE
public void handlePageException(ExceptionSE ex) throws ServletExceptionEE, IOExceptionSE
PageContextEE の handlePageExceptionEE ServletExceptionEEIOExceptionSEpublic void handlePageException(ThrowableSE ex) throws ServletExceptionEE, IOExceptionSE
PageContextEE の handlePageExceptionEE ServletExceptionEEIOExceptionSE