|
||||||||||
| 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
com.mockrunner.mock.web.MockPageContext
public class MockPageContext
Mock implementation of PageContext.
Please note that EL support using the
the Unified Expression Language API is only available,
if the JasperJspFactory is configured as the default
JspFactory. By default, getELContext()
returns null.
| Field Summary | |
|---|---|
protected javax.servlet.ServletConfig |
config
|
protected javax.servlet.ServletRequest |
request
|
protected javax.servlet.ServletResponse |
response
|
| 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()
|
|
MockPageContext(javax.servlet.ServletConfig config,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
findAttribute(java.lang.String name)
|
void |
forward(java.lang.String path)
|
java.lang.Object |
getAttribute(java.lang.String name)
|
java.lang.Object |
getAttribute(java.lang.String name,
int scope)
|
java.util.Enumeration |
getAttributeNamesInScope(int scope)
|
int |
getAttributesScope(java.lang.String name)
|
javax.el.ELContext |
getELContext()
|
java.lang.Exception |
getException()
|
javax.servlet.jsp.el.ExpressionEvaluator |
getExpressionEvaluator()
|
javax.servlet.jsp.JspWriter |
getOut()
|
java.lang.Object |
getPage()
|
javax.servlet.ServletRequest |
getRequest()
|
javax.servlet.ServletResponse |
getResponse()
|
javax.servlet.ServletConfig |
getServletConfig()
|
javax.servlet.ServletContext |
getServletContext()
|
javax.servlet.http.HttpSession |
getSession()
|
javax.servlet.jsp.el.VariableResolver |
getVariableResolver()
|
void |
handlePageException(java.lang.Exception exc)
|
void |
handlePageException(java.lang.Throwable thr)
|
void |
include(java.lang.String path)
|
void |
include(java.lang.String path,
boolean flush)
|
void |
initialize(javax.servlet.Servlet servlet,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
java.lang.String errorPageURL,
boolean needsSession,
int bufferSize,
boolean autoFlush)
|
javax.servlet.jsp.JspWriter |
popBody()
|
javax.servlet.jsp.tagext.BodyContent |
pushBody()
|
javax.servlet.jsp.JspWriter |
pushBody(java.io.Writer writer)
|
void |
release()
|
void |
removeAttribute(java.lang.String name)
|
void |
removeAttribute(java.lang.String name,
int scope)
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
|
void |
setAttribute(java.lang.String name,
java.lang.Object value,
int scope)
|
void |
setELContext(javax.el.ELContext elContext)
Sets the ELContext. |
void |
setException(java.lang.Exception exception)
|
void |
setExpressionEvaluator(javax.servlet.jsp.el.ExpressionEvaluator evaluator)
Sets the expression evaluator. |
void |
setJspWriter(javax.servlet.jsp.JspWriter jspWriter)
This method allows to set custom implementations of JspWriter. |
void |
setPage(java.lang.Object page)
|
void |
setServletConfig(javax.servlet.ServletConfig config)
Sets the ServletConfig. |
void |
setServletRequest(javax.servlet.ServletRequest request)
Sets the ServletRequest. |
void |
setServletResponse(javax.servlet.ServletResponse response)
Sets the ServletResponse. |
void |
setVariableResolver(javax.servlet.jsp.el.VariableResolver resolver)
Sets the variable resolver. |
| Methods inherited from class javax.servlet.jsp.PageContext |
|---|
getErrorData |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected javax.servlet.ServletConfig config
protected javax.servlet.ServletRequest request
protected javax.servlet.ServletResponse response
| Constructor Detail |
|---|
public MockPageContext()
public MockPageContext(javax.servlet.ServletConfig config,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
| Method Detail |
|---|
public void setJspWriter(javax.servlet.jsp.JspWriter jspWriter)
JspWriter. Per default, MockJspWriter
is used.
jspWriter - the JspWriterpublic void setPage(java.lang.Object page)
public void setServletConfig(javax.servlet.ServletConfig config)
ServletConfig.
config - the ServletConfigpublic void setServletRequest(javax.servlet.ServletRequest request)
ServletRequest.
request - the ServletRequestpublic void setServletResponse(javax.servlet.ServletResponse response)
ServletResponse.
response - the ServletResponsepublic void setException(java.lang.Exception exception)
public java.lang.Object findAttribute(java.lang.String name)
findAttribute in class javax.servlet.jsp.JspContextpublic java.lang.Object getAttribute(java.lang.String name)
getAttribute in class javax.servlet.jsp.JspContext
public java.lang.Object getAttribute(java.lang.String name,
int scope)
getAttribute in class javax.servlet.jsp.JspContextpublic void removeAttribute(java.lang.String name)
removeAttribute in class javax.servlet.jsp.JspContext
public void removeAttribute(java.lang.String name,
int scope)
removeAttribute in class javax.servlet.jsp.JspContext
public void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in class javax.servlet.jsp.JspContext
public void setAttribute(java.lang.String name,
java.lang.Object value,
int scope)
setAttribute in class javax.servlet.jsp.JspContextpublic int getAttributesScope(java.lang.String name)
getAttributesScope in class javax.servlet.jsp.JspContextpublic java.util.Enumeration getAttributeNamesInScope(int scope)
getAttributeNamesInScope in class javax.servlet.jsp.JspContextpublic javax.servlet.jsp.JspWriter getOut()
getOut in class javax.servlet.jsp.JspContextpublic java.lang.Exception getException()
getException in class javax.servlet.jsp.PageContextpublic java.lang.Object getPage()
getPage in class javax.servlet.jsp.PageContextpublic javax.servlet.ServletRequest getRequest()
getRequest in class javax.servlet.jsp.PageContextpublic javax.servlet.ServletResponse getResponse()
getResponse in class javax.servlet.jsp.PageContextpublic javax.servlet.ServletConfig getServletConfig()
getServletConfig in class javax.servlet.jsp.PageContextpublic javax.servlet.ServletContext getServletContext()
getServletContext in class javax.servlet.jsp.PageContextpublic javax.servlet.http.HttpSession getSession()
getSession in class javax.servlet.jsp.PageContextpublic void handlePageException(java.lang.Exception exc)
handlePageException in class javax.servlet.jsp.PageContextpublic void handlePageException(java.lang.Throwable thr)
handlePageException in class javax.servlet.jsp.PageContext
public void forward(java.lang.String path)
throws javax.servlet.ServletException,
java.io.IOException
forward in class javax.servlet.jsp.PageContextjavax.servlet.ServletException
java.io.IOException
public void include(java.lang.String path)
throws javax.servlet.ServletException,
java.io.IOException
include in class javax.servlet.jsp.PageContextjavax.servlet.ServletException
java.io.IOException
public void include(java.lang.String path,
boolean flush)
throws javax.servlet.ServletException,
java.io.IOException
include in class javax.servlet.jsp.PageContextjavax.servlet.ServletException
java.io.IOException
public void initialize(javax.servlet.Servlet servlet,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
java.lang.String errorPageURL,
boolean needsSession,
int bufferSize,
boolean autoFlush)
initialize in class javax.servlet.jsp.PageContextpublic javax.servlet.jsp.JspWriter popBody()
popBody in class javax.servlet.jsp.JspContextpublic javax.servlet.jsp.tagext.BodyContent pushBody()
pushBody in class javax.servlet.jsp.PageContextpublic javax.servlet.jsp.JspWriter pushBody(java.io.Writer writer)
pushBody in class javax.servlet.jsp.JspContextpublic void release()
release in class javax.servlet.jsp.PageContextpublic void setExpressionEvaluator(javax.servlet.jsp.el.ExpressionEvaluator evaluator)
MockExpressionEvaluator.
evaluator - the ExpressionEvaluatorpublic void setVariableResolver(javax.servlet.jsp.el.VariableResolver resolver)
MockVariableResolver.
resolver - the VariableResolverpublic void setELContext(javax.el.ELContext elContext)
ELContext. There is no default
ELContext. Configure the JasperJspFactory
to set one.
elContext - the ELContextpublic javax.servlet.jsp.el.ExpressionEvaluator getExpressionEvaluator()
getExpressionEvaluator in class javax.servlet.jsp.JspContextpublic javax.servlet.jsp.el.VariableResolver getVariableResolver()
getVariableResolver in class javax.servlet.jsp.JspContextpublic javax.el.ELContext getELContext()
getELContext in class javax.servlet.jsp.JspContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||