| Author |
storing objects in pageContext
|
varun prakash
Greenhorn
Joined: Oct 12, 2006
Posts: 17
|
|
As per my understanding calling pageContext.setAttribute(key,object) stores the object in page scope.My question is whether it is stored inside pageContext.Means like implicit Object, requestScope and applicationScope,pageContext is also a map.(or)pageContext is just a way to store the objects inside any of the scopes. Are Objects with page scope stored in the PageContext(implicit object)???
|
SCJP - 98%<br />SCWCD - 89%
|
 |
Kaveriappa Poonacha
Greenhorn
Joined: Feb 15, 2006
Posts: 10
|
|
Hi Varun, the inheritance tree for PageContext: java.lang.Object extended by javax.servlet.jsp.JspContext extended by javax.servlet.jsp.PageContext Please refer the excellent JSP API Javadocs. Hope this answers your question.
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Kaveriappa MP Welcome to JavaRanch! We're pleased to have you here with us in the FORUM_NAME forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it. In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. You can change it here
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
varun prakash
Greenhorn
Joined: Oct 12, 2006
Posts: 17
|
|
Thanks for your reply. I want to reframe my question a little bit. Attributes stored in request scope are stored in Implicit object requestScope(map).Similarly where pageScope attributes are stored? Since PageContext is not an object,page Scope attributes cannot be stored in pageContext.Am i correct?
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12266
|
|
Since PageContext is not an object,page Scope attributes cannot be stored in pageContext.Am i correct?
I suggest that you read the javadocs for javax.servlet.jsp.PageContext - an abstract Class. There is a nice discussion of all of the facilities that a PageContext supplies. Bill
|
Java Resources at www.wbrogden.com
|
 |
Stefan Evans
Bartender
Joined: Jul 06, 2005
Posts: 1002
|
|
The request object stores its attributes in some way. The pageContext object stores its attributes in some way. How these objects store their attributes is irrelevant to you. They could be stored in a map (and probably are) but they don't have to be. The implicit objects revealed to EL as Maps: pageScope, requestScope, sessionScope etc etc are seperate. So you have two implicit variables. pageContext - for accessing the pageContext object pageScope - for accessing the attributes stored in the pageContext. It gets them by calling pageContext.getAttribute() Does that clear things up?
|
 |
varun prakash
Greenhorn
Joined: Oct 12, 2006
Posts: 17
|
|
|
Thanks to all for the reply
|
 |
 |
|
|
subject: storing objects in pageContext
|
|
|