aspose file tools*
The moose likes JSP and the fly likes Regarding Page Scope Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Regarding Page Scope" Watch "Regarding Page Scope" New topic
Author

Regarding Page Scope

rakesh kadulkar
Ranch Hand

Joined: Jul 24, 2008
Posts: 115
Hi

can some one explain me why do I need a page scope if the attribute is available only th the same page.

Thanks you.







Rakesh Kadulkar
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Why you need a method local variable ?


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30758
    
156

I've used it if I need to pass information from one tag to another. For example, the navigation menu to the breadcrumbs. I'm sure there's a better way of doing it, but this was the easiest way to migrate pre "don't have Java code in your pages" tag files/jsp fragments.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61424
    
  67

Whenever you want the scoped variable to only be available in the current page. I use it all the time.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
vinnu kumar
Greenhorn

Joined: Sep 10, 2007
Posts: 12
rakesh kankavlikar wrote:Hi

can some one explain me why do I need a page scope if the attribute is available only th the same page.

Thanks you.








with page scope you can access objects within the pages where they were created
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Regarding Page Scope