• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PageContext - Does it "actually" exists?

 
Atul Sawant
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oi!

Could someone please explain me the below given statement....

Technically, pageContext can also store attributes in any scope using setAttribute(name, object, scope) method. But the objects thus stored are actually not stored in pageContext. pageContext just provides a convenient method to store the objects in actual scopes such as application, session.


So, which is default scope is considered to set an attribute using a PageContext.setAttribute(String name) method?

Thanks for your answers!
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean setAttribute(String name,Object value) ? It's page scope.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I guess it's just saying that if you use a method in the pageContext to store something in the HttpSession, it gets stored in the HttpSession, not the pageContext.

Just trying to explain some of the helper methods in the pageContext.

-Cameron
 
Atul Sawant
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Satou - hello there...hope you doing fine.

I meant for PageContext.setAttribute(String name).

@Cameron - I guess you meant for a method which is something like this...

PageContext.setAttribute("person", person, Session_Scope), correct?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic