Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please explain with an example.
Posted

Hello Shruthi,

PageContext is used for storing and retrieving page-related information and sharing objects within the same translation unit and same request. It is also used as a convenience class that maintains a table of all the other implicit objects. For example
Java
try { 
    ... 
    application = pageContext.getServletContext();
    config = pageContext.getServletConfig();
    session = pageContext.getSession();
    out = pageContext.getOut(); 
    ... 
} catch (Throwable t) {
    ... 
}

The Session on the other hand provides a way to identify a user across more than one page request or visit to a Web site and to store information about that user.

The PageContext is provisioned for the scope of processing a page (Request) and is short lived compared to a session.

Regards,
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900