*
The moose likes Struts and the fly likes Scope of ActionForm 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 » Frameworks » Struts
Bookmark "Scope of ActionForm" Watch "Scope of ActionForm" New topic
Author

Scope of ActionForm

Deepika Saxena
Ranch Hand

Joined: Jul 05, 2009
Posts: 59
Hi,
could any body clarify what is the scope of an ActionForm? I know that each ActionForm is associated with a servlet and thus the scope of an ActionForm is the associated Servlet. Please correct me if i am wrong.

Thanks.
--Deepika.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30123
    
150

Deepika Saxena wrote:could any body clarify what is the scope of an ActionForm?

It depends on what you set in the Struts Config file. It could be request or session.

Deepika Saxena wrote:I know that each ActionForm is associated with a servlet and thus the scope of an ActionForm is the associated Servlet.

Is it? There's usually only one servlet and many actions. Actions can have their own forms or share them.


[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
Deepika Saxena
Ranch Hand

Joined: Jul 05, 2009
Posts: 59
Hi jeanne,
Thanks for the response and correcting me. If Actions can share Action Forms among them, please let me know how this can be achieved.
--Deepika
 
wood burning stoves
 
subject: Scope of ActionForm
 
Similar Threads
Form Submission without ActionForm in Struts 1.3.
HttpSession equals null in Action class
Struts 2 - Getting values from action in JSP pages using scriplet?
why bother with struts HTML tags?
Struts Action Intances