This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes default scopes of form bean and data bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "default scopes of form bean and data bean" Watch "default scopes of form bean and data bean" New topic
Author

default scopes of form bean and data bean

Srinivasa Datla
Greenhorn

Joined: Jan 08, 2007
Posts: 7
Can anybody tell me what are the default scopes of Form bean and data bean?
Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 437
request scope will b default if not mistaken
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
The default for an ActionForm is "session". I was looking for documentation to back this up...I am sure there is a page that lists the default values but the best I could turn up in under 1 minute was this page that says:

"ActionForms can be stored in either the session (default) or request scopes"

http://struts.apache.org/1.1/userGuide/building_controller.html#action_form_classes

You can configure your application to use the class RequestActionMapping which would cause the default to be "request", but out of the box "session" is the default.

I have no idea what you mean be "data bean".

- Brent
Milan Jagatiya
Ranch Hand

Joined: Jan 01, 2007
Posts: 164
hi,

The default scope of an ActionForm is session.
I am not getting "data bean ". can you explain what is it?

milan.


Milan.<br />I can because I think I can...
Srinivasa Datla
Greenhorn

Joined: Jan 08, 2007
Posts: 7
Thanks for all.
i mean data bean is a java bean.
I got the answers as java bean has a page scope and form bean has a session scope as default.

- Sri
Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 437
thank you Brent Sterling and Milan Jagatiya for correction, and sorry for causing any confusing Srinivasa Datla

i normally have all the action in request scope, and it does confuse me the default scope was request
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: default scopes of form bean and data bean
 
Similar Threads
jsp:useBean doubt
Regarding c:set tag
view bean???
how to make html:radio default selected
How can i reset the form bean data