|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.PageContext org.springframework.mock.web.MockPageContext
Mock implementation of the 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.
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 MockServletContext, MockHttpServletRequest, MockHttpServletResponse, MockServletConfig. |
|
MockPageContext(ServletContext servletContext)
Create new MockPageContext with a 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. |
Method Summary | |
Object |
findAttribute(String name)
|
void |
forward(String url)
|
Object |
getAttribute(String name)
|
Object |
getAttribute(String name,
int scope)
|
Enumeration |
getAttributeNames()
|
Enumeration |
getAttributeNamesInScope(int scope)
|
int |
getAttributesScope(String name)
|
Exception |
getException()
|
JspWriter |
getOut()
|
Object |
getPage()
|
ServletRequest |
getRequest()
|
ServletResponse |
getResponse()
|
ServletConfig |
getServletConfig()
|
ServletContext |
getServletContext()
|
HttpSession |
getSession()
|
void |
handlePageException(Exception ex)
|
void |
handlePageException(Throwable throwable)
|
void |
include(String url)
|
void |
initialize(Servlet servlet,
ServletRequest request,
ServletResponse response,
String errorPageURL,
boolean needsSession,
int bufferSize,
boolean autoFlush)
|
void |
release()
|
void |
removeAttribute(String name)
|
void |
removeAttribute(String name,
int scope)
|
void |
setAttribute(String name,
Object value)
|
void |
setAttribute(String name,
Object value,
int scope)
|
Methods inherited from class javax.servlet.jsp.PageContext |
popBody, pushBody |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MockPageContext()
public MockPageContext(ServletContext servletContext)
servletContext
- the ServletContext that the servlet runs in
(only necessary when accessing the ServletContext)public MockPageContext(ServletContext servletContext, HttpServletRequest request)
servletContext
- the ServletContext that the servlet runs inrequest
- the current HttpServletRequest
(only necessary when accessing the request)public MockPageContext(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response)
servletContext
- the ServletContext that the servlet runs inrequest
- the current HttpServletRequestresponse
- the current HttpServletResponse
(only necessary when writing to the response)public MockPageContext(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, ServletConfig servletConfig)
servletContext
- the ServletContext that the servlet 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)
public void release()
public void setAttribute(String name, Object value)
public void setAttribute(String name, Object value, int scope)
public Object getAttribute(String name)
public Object getAttribute(String name, int scope)
public Object findAttribute(String name)
public void removeAttribute(String name)
public void removeAttribute(String name, int scope)
public int getAttributesScope(String name)
public Enumeration getAttributeNames()
public Enumeration getAttributeNamesInScope(int scope)
public JspWriter getOut()
public HttpSession getSession()
public Object getPage()
public ServletRequest getRequest()
public ServletResponse getResponse()
public Exception getException()
public ServletConfig getServletConfig()
public ServletContext getServletContext()
public void forward(String url) throws ServletException, IOException
ServletException
IOException
public void include(String url) throws ServletException, IOException
ServletException
IOException
public void handlePageException(Exception ex) throws ServletException, IOException
ServletException
IOException
public void handlePageException(Throwable throwable) throws ServletException, IOException
ServletException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |