|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.jsp.JspContext
javax.servlet.jsp.PageContext
org.springframework.mock.web.MockPageContext
public class MockPageContext
Mock implementation of the PageContext interface.
Used for testing the web framework; only necessary for testing applications when testing custom JSP tags.
Note: Expects initialization via the constructor rather than via the
PageContext.initialize method. Does not support writing to
a JspWriter, request dispatching, and handlePageException calls.
| Field Summary |
|---|
| Fields inherited from class javax.servlet.jsp.PageContext |
|---|
APPLICATION, APPLICATION_SCOPE, CONFIG, EXCEPTION, OUT, PAGE, PAGE_SCOPE, PAGECONTEXT, REQUEST, REQUEST_SCOPE, RESPONSE, SESSION, SESSION_SCOPE |
| Constructor Summary | |
|---|---|
MockPageContext()
Create new MockPageContext with a default MockServletContext,
MockHttpServletRequest, MockHttpServletResponse,
MockServletConfig. |
|
MockPageContext(ServletContext servletContext)
Create new MockPageContext with a default MockHttpServletRequest,
MockHttpServletResponse, MockServletConfig. |
|
MockPageContext(ServletContext servletContext,
HttpServletRequest request)
Create new MockPageContext with a MockHttpServletResponse, MockServletConfig. |
|
MockPageContext(ServletContext servletContext,
HttpServletRequest request,
HttpServletResponse response)
Create new MockPageContext with a MockServletConfig. |
|
MockPageContext(ServletContext servletContext,
HttpServletRequest request,
HttpServletResponse response,
ServletConfig servletConfig)
Create new MockServletConfig. |
|
| Methods inherited from class javax.servlet.jsp.PageContext |
|---|
getErrorData, pushBody |
| Methods inherited from class javax.servlet.jsp.JspContext |
|---|
popBody, pushBody |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MockPageContext()
MockServletContext,
MockHttpServletRequest, MockHttpServletResponse,
MockServletConfig.
public MockPageContext(ServletContext servletContext)
MockHttpServletRequest,
MockHttpServletResponse, MockServletConfig.
servletContext - the ServletContext that the JSP page runs in
(only necessary when actually accessing the ServletContext)
public MockPageContext(ServletContext servletContext,
HttpServletRequest request)
servletContext - the ServletContext that the JSP page runs inrequest - the current HttpServletRequest
(only necessary when actually accessing the request)
public MockPageContext(ServletContext servletContext,
HttpServletRequest request,
HttpServletResponse response)
servletContext - the ServletContext that the JSP page runs inrequest - the current HttpServletRequestresponse - the current HttpServletResponse
(only necessary when actually writing to the response)
public MockPageContext(ServletContext servletContext,
HttpServletRequest request,
HttpServletResponse response,
ServletConfig servletConfig)
servletContext - the ServletContext that the JSP page runs inrequest - the current HttpServletRequestresponse - the current HttpServletResponseservletConfig - the ServletConfig (hardly ever accessed from within a tag)| Method Detail |
|---|
public void initialize(Servlet servlet,
ServletRequest request,
ServletResponse response,
String errorPageURL,
boolean needsSession,
int bufferSize,
boolean autoFlush)
initialize in class PageContextpublic void release()
release in class PageContext
public void setAttribute(String name,
Object value)
setAttribute in class JspContext
public void setAttribute(String name,
Object value,
int scope)
setAttribute in class JspContextpublic Object getAttribute(String name)
getAttribute in class JspContext
public Object getAttribute(String name,
int scope)
getAttribute in class JspContextpublic Object findAttribute(String name)
findAttribute in class JspContextpublic void removeAttribute(String name)
removeAttribute in class JspContext
public void removeAttribute(String name,
int scope)
removeAttribute in class JspContextpublic int getAttributesScope(String name)
getAttributesScope in class JspContextpublic Enumeration getAttributeNames()
public Enumeration getAttributeNamesInScope(int scope)
getAttributeNamesInScope in class JspContextpublic JspWriter getOut()
getOut in class JspContextpublic ExpressionEvaluator getExpressionEvaluator()
getExpressionEvaluator in class JspContextpublic VariableResolver getVariableResolver()
getVariableResolver in class JspContextpublic HttpSession getSession()
getSession in class PageContextpublic Object getPage()
getPage in class PageContextpublic ServletRequest getRequest()
getRequest in class PageContextpublic ServletResponse getResponse()
getResponse in class PageContextpublic Exception getException()
getException in class PageContextpublic ServletConfig getServletConfig()
getServletConfig in class PageContextpublic ServletContext getServletContext()
getServletContext in class PageContext
public void forward(String url)
throws ServletException,
IOException
forward in class PageContextServletException
IOException
public void include(String url)
throws ServletException,
IOException
include in class PageContextServletException
IOException
public void include(String url,
boolean flush)
throws ServletException,
IOException
include in class PageContextServletException
IOException
public void handlePageException(Exception ex)
throws ServletException,
IOException
handlePageException in class PageContextServletException
IOException
public void handlePageException(Throwable ex)
throws ServletException,
IOException
handlePageException in class PageContextServletException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||