File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes PageContext - Does it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "PageContext - Does it "actually" exists?" Watch "PageContext - Does it "actually" exists?" New topic

PageContext - Does it "actually" exists?

Atul Sawant
Ranch Hand

Joined: Jul 06, 2006
Posts: 304

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!

Mission SCWCD. Mission SCJP Complete: SCJP 1.4 - 91%
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

You mean setAttribute(String name,Object value) ? It's page scope.

[My Blog]
All roads lead to JavaRanch
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

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.

Atul Sawant
Ranch Hand

Joined: Jul 06, 2006
Posts: 304
@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?
I agree. Here's the link:
subject: PageContext - Does it "actually" exists?
It's not a secret anymore!