This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes why we need page scope Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "why we need page scope" Watch "why we need page scope" New topic
Author

why we need page scope

vijay saraf
Ranch Hand

Joined: Jan 08, 2005
Posts: 141
Hello All ,

if i declare a bean in a jsp then by default it will be visible to that page,then setting scope as page;what addition functionalties will adds to it.i just mean to ask what addtional functionalties are there in page scope that are not with default( means no scope).

Thanks,
Vijay Saraf.


Thanks
Vijay Saraf.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Default is page scope, not "no scope".
You will use a page scope when some information does not need to be used outside the current page.


[My Blog]
All roads lead to JavaRanch
vijay saraf
Ranch Hand

Joined: Jan 08, 2005
Posts: 141
That is fine.
but suppose i am not defining any scope in <jsp:useBean> then still that bean instance is avialable any where in that page.
and again if i define scope as page then the visibility of bean is same.
i just wanted to know is there any diffrence or not.

Thanks,
Vijay Saraf.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Did you read the spec about <jsp:useBean> ?
If you do not explicitly set the scope to scope="page", then default is scope="page". No difference.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why we need page scope
 
Similar Threads
default scope of JSP page
default scope
scope value in jsp:useBean standard action
Doubt in jsp:useBean
scope of bean in jsp