Class JspContextWrapper
java.lang.Object
javax.servlet.jsp.JspContext
javax.servlet.jsp.PageContext
org.apache.jasper.runtime.JspContextWrapper
public class JspContextWrapper
extends javax.servlet.jsp.PageContext
Implementation of a JSP Context Wrapper.
The JSP Context Wrapper is a JspContext created and maintained by a tag
handler implementation. It wraps the Invoking JSP Context, that is, the
JspContext instance passed to the tag handler by the invoking page via
setJspContext().
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javax.el.ELContextprivate javax.servlet.jsp.PageContextFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcopyTagToPageScope(int scope) Copies the variables of the given scope from the virtual page scope of this JSP context wrapper to the page scope of the invoking JSP context.private StringChecks to see if the given variable name is used as an alias, and if so, returns the variable name for which it is used as an alias.findAttribute(String name) voidgetAttribute(String name) getAttribute(String name, int scope) getAttributeNamesInScope(int scope) intgetAttributesScope(String name) javax.el.ELContextjavax.servlet.jsp.el.ExpressionEvaluatorjavax.servlet.jsp.JspWritergetOut()getPage()javax.servlet.ServletRequestjavax.servlet.ServletResponsestatic javax.servlet.jsp.PageContextgetRootPageContext(javax.servlet.jsp.PageContext pc) javax.servlet.ServletConfigjavax.servlet.ServletContextjavax.servlet.http.HttpSessionjavax.servlet.jsp.el.VariableResolvervoidvoidvoidvoidvoidinitialize(javax.servlet.Servlet servlet, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) javax.servlet.jsp.JspWriterpopBody()javax.servlet.jsp.tagext.BodyContentpushBody()javax.servlet.jsp.JspWritervoidrelease()voidremoveAttribute(String name) voidremoveAttribute(String name, int scope) private voidRestores the values of any NESTED variables in the invoking JSP context.private voidSaves the values of any NESTED variables that are present in the invoking JSP context, so they can later be restored.voidsetAttribute(String name, Object value) voidsetAttribute(String name, Object value, int scope) voidSynchronize variables before fragment invokationvoidSynchronize variables at begin of tag filevoidSynchronize variables at end of tag fileMethods inherited from class javax.servlet.jsp.PageContext
getErrorData
-
Field Details
-
invokingJspCtxt
private javax.servlet.jsp.PageContext invokingJspCtxt -
pageAttributes
-
nestedVars
-
atBeginVars
-
atEndVars
-
aliases
-
originalNestedVars
-
elContext
private javax.el.ELContext elContext
-
-
Constructor Details
-
JspContextWrapper
-
-
Method Details
-
initialize
public void initialize(javax.servlet.Servlet servlet, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) throws IOException, IllegalStateException, IllegalArgumentException - Specified by:
initializein classjavax.servlet.jsp.PageContext- Throws:
IOExceptionIllegalStateExceptionIllegalArgumentException
-
getAttribute
-
getAttribute
-
setAttribute
-
setAttribute
-
findAttribute
-
removeAttribute
- Specified by:
removeAttributein classjavax.servlet.jsp.JspContext
-
removeAttribute
- Specified by:
removeAttributein classjavax.servlet.jsp.JspContext
-
getAttributesScope
- Specified by:
getAttributesScopein classjavax.servlet.jsp.JspContext
-
getAttributeNamesInScope
- Specified by:
getAttributeNamesInScopein classjavax.servlet.jsp.JspContext
-
release
public void release()- Specified by:
releasein classjavax.servlet.jsp.PageContext
-
getOut
public javax.servlet.jsp.JspWriter getOut()- Specified by:
getOutin classjavax.servlet.jsp.JspContext
-
getSession
public javax.servlet.http.HttpSession getSession()- Specified by:
getSessionin classjavax.servlet.jsp.PageContext
-
getPage
- Specified by:
getPagein classjavax.servlet.jsp.PageContext
-
getRequest
public javax.servlet.ServletRequest getRequest()- Specified by:
getRequestin classjavax.servlet.jsp.PageContext
-
getResponse
public javax.servlet.ServletResponse getResponse()- Specified by:
getResponsein classjavax.servlet.jsp.PageContext
-
getException
- Specified by:
getExceptionin classjavax.servlet.jsp.PageContext
-
getServletConfig
public javax.servlet.ServletConfig getServletConfig()- Specified by:
getServletConfigin classjavax.servlet.jsp.PageContext
-
getServletContext
public javax.servlet.ServletContext getServletContext()- Specified by:
getServletContextin classjavax.servlet.jsp.PageContext
-
getRootPageContext
public static javax.servlet.jsp.PageContext getRootPageContext(javax.servlet.jsp.PageContext pc) -
getELContext
public javax.el.ELContext getELContext()- Specified by:
getELContextin classjavax.servlet.jsp.JspContext
-
forward
- Specified by:
forwardin classjavax.servlet.jsp.PageContext- Throws:
javax.servlet.ServletExceptionIOException
-
include
- Specified by:
includein classjavax.servlet.jsp.PageContext- Throws:
javax.servlet.ServletExceptionIOException
-
include
public void include(String relativeUrlPath, boolean flush) throws javax.servlet.ServletException, IOException - Specified by:
includein classjavax.servlet.jsp.PageContext- Throws:
javax.servlet.ServletExceptionIOException
-
getVariableResolver
public javax.servlet.jsp.el.VariableResolver getVariableResolver()- Specified by:
getVariableResolverin classjavax.servlet.jsp.JspContext
-
pushBody
public javax.servlet.jsp.tagext.BodyContent pushBody()- Overrides:
pushBodyin classjavax.servlet.jsp.PageContext
-
pushBody
- Overrides:
pushBodyin classjavax.servlet.jsp.JspContext
-
popBody
public javax.servlet.jsp.JspWriter popBody()- Overrides:
popBodyin classjavax.servlet.jsp.JspContext
-
getExpressionEvaluator
public javax.servlet.jsp.el.ExpressionEvaluator getExpressionEvaluator()- Specified by:
getExpressionEvaluatorin classjavax.servlet.jsp.JspContext
-
handlePageException
- Specified by:
handlePageExceptionin classjavax.servlet.jsp.PageContext- Throws:
IOExceptionjavax.servlet.ServletException
-
handlePageException
- Specified by:
handlePageExceptionin classjavax.servlet.jsp.PageContext- Throws:
IOExceptionjavax.servlet.ServletException
-
syncBeginTagFile
public void syncBeginTagFile()Synchronize variables at begin of tag file -
syncBeforeInvoke
public void syncBeforeInvoke()Synchronize variables before fragment invokation -
syncEndTagFile
public void syncEndTagFile()Synchronize variables at end of tag file -
copyTagToPageScope
private void copyTagToPageScope(int scope) Copies the variables of the given scope from the virtual page scope of this JSP context wrapper to the page scope of the invoking JSP context.- Parameters:
scope- variable scope (one of NESTED, AT_BEGIN, or AT_END)
-
saveNestedVariables
private void saveNestedVariables()Saves the values of any NESTED variables that are present in the invoking JSP context, so they can later be restored. -
restoreNestedVariables
private void restoreNestedVariables()Restores the values of any NESTED variables in the invoking JSP context. -
findAlias
Checks to see if the given variable name is used as an alias, and if so, returns the variable name for which it is used as an alias.- Parameters:
varName- The variable name to check- Returns:
- The variable name for which varName is used as an alias, or varName if it is not being used as an alias
-