Class JspContext

java.lang.Object
jakarta.servlet.jsp.JspContext
Direct Known Subclasses:
PageContext

public abstract class JspContext extends Object

JspContext serves as the base class for the PageContext class and abstracts all information that is not specific to servlets. This allows for Simple Tag Extensions to be used outside of the context of a request/response Servlet.

The JspContext provides a number of facilities to the page/component author and page implementor, including:

  • a single API to manage the various scoped namespaces
  • a mechanism to obtain the JspWriter for output
  • a mechanism to expose page directive attributes to the scripting environment

Methods Intended for Container Generated Code

The following methods enable the management of nested JspWriter streams to implement Tag Extensions: pushBody() and popBody()

Methods Intended for JSP authors

Some methods provide uniform access to the diverse objects representing scopes. The implementation must use the underlying machinery corresponding to that scope, so information can be passed back and forth between the underlying environment (e.g. Servlets) and JSP pages. The methods are: setAttribute(), getAttribute(), findAttribute(), removeAttribute(), getAttributesScope() and getAttributeNamesInScope().

The following methods provide convenient access to implicit objects: getOut()

Since:
JSP 2.0