| javax.servlet.jsp.PageContext org.springframework.mock.web.MockPageContext
MockPageContext | public class MockPageContext extends PageContext (Code) | | Mock implementation of the
javax.servlet.jsp.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.
author: Juergen Hoeller since: 1.0.2 |
Constructor Summary | |
public | MockPageContext() Create new MockPageContext with a default
MockServletContext ,
MockHttpServletRequest ,
MockHttpServletResponse ,
MockServletConfig . | public | MockPageContext(ServletContext servletContext) Create new MockPageContext with a default
MockHttpServletRequest ,
MockHttpServletResponse ,
MockServletConfig . | public | MockPageContext(ServletContext servletContext, HttpServletRequest request) Create new MockPageContext with a MockHttpServletResponse,
MockServletConfig. | public | MockPageContext(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response) Create new MockPageContext with a MockServletConfig. | public | MockPageContext(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, ServletConfig servletConfig) Create new MockServletConfig. |
Method Summary | |
public Object | findAttribute(String name) | public void | forward(String url) | public Object | getAttribute(String name) | public Object | getAttribute(String name, int scope) | public Enumeration | getAttributeNames() | public Enumeration | getAttributeNamesInScope(int scope) | public int | getAttributesScope(String name) | public Exception | getException() | public ExpressionEvaluator | getExpressionEvaluator() | public JspWriter | getOut() | public Object | getPage() | public ServletRequest | getRequest() | public ServletResponse | getResponse() | public ServletConfig | getServletConfig() | public ServletContext | getServletContext() | public HttpSession | getSession() | public VariableResolver | getVariableResolver() | public void | handlePageException(Exception ex) | public void | handlePageException(Throwable ex) | public void | include(String url) | public void | include(String url, boolean flush) | public void | initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) | public void | release() | public void | removeAttribute(String name) | public void | removeAttribute(String name, int scope) | public void | setAttribute(String name, Object value) | public void | setAttribute(String name, Object value, int scope) |
MockPageContext | public MockPageContext(ServletContext servletContext, HttpServletRequest request)(Code) | | Create new MockPageContext with a MockHttpServletResponse,
MockServletConfig.
Parameters: servletContext - the ServletContext that the JSP page runs in Parameters: request - the current HttpServletRequest(only necessary when actually accessing the request) |
MockPageContext | public MockPageContext(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response)(Code) | | Create new MockPageContext with a MockServletConfig.
Parameters: servletContext - the ServletContext that the JSP page runs in Parameters: request - the current HttpServletRequest Parameters: response - the current HttpServletResponse(only necessary when actually writing to the response) |
MockPageContext | public MockPageContext(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, ServletConfig servletConfig)(Code) | | Create new MockServletConfig.
Parameters: servletContext - the ServletContext that the JSP page runs in Parameters: request - the current HttpServletRequest Parameters: response - the current HttpServletResponse Parameters: servletConfig - the ServletConfig (hardly ever accessed from within a tag) |
getAttributesScope | public int getAttributesScope(String name)(Code) | | |
release | public void release()(Code) | | |
removeAttribute | public void removeAttribute(String name)(Code) | | |
removeAttribute | public void removeAttribute(String name, int scope)(Code) | | |
Methods inherited from javax.servlet.jsp.PageContext | abstract public void forward(String relativeUrlPath) throws ServletException, IOException(Code)(Java Doc) public ErrorData getErrorData()(Code)(Java Doc) abstract public Exception getException()(Code)(Java Doc) abstract public Object getPage()(Code)(Java Doc) abstract public ServletRequest getRequest()(Code)(Java Doc) abstract public ServletResponse getResponse()(Code)(Java Doc) abstract public ServletConfig getServletConfig()(Code)(Java Doc) abstract public ServletContext getServletContext()(Code)(Java Doc) abstract public HttpSession getSession()(Code)(Java Doc) abstract public void handlePageException(Exception e) throws ServletException, IOException(Code)(Java Doc) abstract public void handlePageException(Throwable t) throws ServletException, IOException(Code)(Java Doc) abstract public void include(String relativeUrlPath) throws ServletException, IOException(Code)(Java Doc) abstract public void include(String relativeUrlPath, boolean flush) throws ServletException, IOException(Code)(Java Doc) abstract public void initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) throws IOException, IllegalStateException, IllegalArgumentException(Code)(Java Doc) public BodyContent pushBody()(Code)(Java Doc) abstract public void release()(Code)(Java Doc)
|
|
|