Jsp Class PageContext

PageContext extends JspContext to provide useful context information for when JSP technology is used in a Servlet environment.
A PageContext instance provides access to all the namespaces associated with a JSP page, provides access to several page attributes, as well as a layer above the implementation details. Implicit objects are added to the pageContext automatically.
The PageContext class is an abstract class, designed to be extended to provide implementation dependent implementations thereof, by conformant JSP engine runtime environments. A PageContext instance is obtained by a JSP implementation class by calling the JspFactory.getPageContext() method, and is released by calling JspFactory.releasePageContext().

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

● a single API to manage the various scoped namespaces.
● a number of convenience API's to access various public objects.
● a mechanism to obtain the JspWriter for output.
● a mechanism to manage session usage by the page.
● a mechanism to expose page directive attributes to the scripting environment.
● mechanisms to forward or include the current request to other active components in the application.
● a mechanism to handle errorpage exception processing.


Methods Intended for Container Generated Code

Some methods are intended to be used by the code generated by the container, not by code written by JSP page authors, or JSP tag library authors.
The methods supporting lifecycle are initialize() and release()
The following methods enable the management of nested JspWriter streams to implement Tag Extensions: pushBody()

Methods Intended for JSP authors

The following methods provide convenient access to implicit objects: getException(), getPage() getRequest(), getResponse(), getSession(), getServletConfig() and getServletContext().
The following methods provide support for forwarding, inclusion and error handling: forward(), include(), and handlePageException().

Here some Field and there description of jsp PageContext

Field NameSummary
static java.lang.StringAPPLICATION
Name used to store ServletContext in PageContext name table.
static intAPPLICATION_SCOPE
Application scope: named reference remains available in the ServletContext until it is reclaimed.
static java.lang.StringCONFIG
Name used to store ServletConfig in PageContext name table.
static java.lang.StringEXCEPTION
Name used to store uncaught exception in ServletRequest attribute list and PageContext name table.
static java.lang.StringOUT
Name used to store current JspWriter in PageContext name table.
static java.lang.StringPAGE
Name used to store the Servlet in this PageContext's nametables.
static intPAGE_SCOPE
Page scope: (this is the default) the named reference remains available in this PageContext until the return from the current Servlet.service() invocation.

Here some Method and there description of jsp PageContext

Method NameSummary
abstract voidforward(java.lang.String relativeUrlPath)
This method is used to re-direct, or "forward" the current ServletRequest and ServletResponse to another active component in the application.
ErrorDatagetErrorData()
Provides convenient access to error information.
abstract java.lang.ExceptiongetException()
The current value of the exception object (an Exception)
abstract java.lang.ObjectgetPage()
The current value of the page object (In a Servlet environment, this is an instance of javax.servlet.Servlet).
abstract
javax.servlet.ServletRequest
getRequest()
The current value of the request object (a ServletRequest).
abstract
javax.servlet.ServletResponse
getResponse()
The current value of the response object (a ServletResponse).
abstract
javax.servlet.ServletConfig
getServletConfig()
The ServletConfig instance.
abstract
javax.servlet.ServletContext
getServletContext()
The ServletContext instance.
abstract
javax.servlet.http.HttpSession
getSession()
The current value of the session object (an HttpSession).
abstract voidhandlePageException(java.lang.Exception e)
This method is intended to process an unhandled 'page' level exception by forwarding the exception to the specified error page for this JSP.
abstract voidhandlePageException(java.lang.Throwable t)
This method is intended to process an unhandled 'page' level exception by forwarding the exception to the specified error page for this JSP.

References : oracle share on :        :  

Love to hear your Views / Guidance / Recommendations on this Post…

Explore the Technology World

Computer Programming Terminologies Computer Programming Terminology is a general word for the group of specialized words or meanings relating to Computer Programming, and also the study of such t ...Read MoreNew features in JDK 12 with IntelliJ IDEADeveloped by JetBrains (formerly known as IntelliJ) ,IntelliJ IDEA is a Java integrated development environment (IDE) for developing computer software. It is av ...Read MoreGoogle Pay API Implementation Demo for AndroidIn this youtube Channel by Android Developers ,Learn how to implement the Google Pay API for Android with just a few lines of code and how it works with your ex ...Read MoreUnit Testing in .NET Core and Azure Devops pipelineUnit testing is a software testing method by which individual units of source code, usage procedures,sets of one or more computer program modules together with ...Read MoreThe mind behind Linux & GIT : Linus TorvaldsLinus Torvalds transformed technology twice — first with the Linux kernel, which helps power the Internet, and again with Git, the source code management ...Read MoreTensorflow and deep learningWith Tensorflow ,deep machine learning transitions from an area of research into mainstream software engineering. ...Read MoreJava program to return all possible permutations from collection of distinct numbersexample of Java program to return all possible permutations from collection of distinct numbers ...Read MoreReal Time Analytics with Spring Application Development FrameworkSpring is the most popular application development framework for enterprise Java.Millions of developers use Spring to build simple, truly portable, fast and fle ...Read MorePath Setting in Java When an application is launched from command prompt Windows OS searches for the executable program in the current working directory. The prompt throws an error ...Read MoreFacebook | whatsapp|Github | Twitter | LinkedIn | Youtube| reddit About | Cookies-Policy | Disclaimer | Site Map | Contact

Call / Visit for New Batch

Services

Why Join Us

  • ➯ Free Demo Classes
  • ➯ No Registration Fee
  • ➯ Interview Questions
  • ➯ Study Materials
  • ➯ Softwares
  • ➯ Aptitude & Reasoning
  • ➯ Placement Assitance

Address

  • MyJava Training Institute ,
  • Plot No.243 , shop No 14 ,
  • Secnd Floor , Zone-II ,
  • M.P.Nagar , Bhopal,
  • Madhya Pradesh ( 462011 )
  • ☎  08871209400 , 7987028543
  • 🌐 www.myjava.in
FacebookGoogle +TwitterYouTube

MyJava - java Training Institute