File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes instance of ActionForm 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 » Frameworks » Struts
Bookmark "instance of ActionForm" Watch "instance of ActionForm" New topic

instance of ActionForm

padmaratna kamble

Joined: Apr 26, 2006
Posts: 26
Hello Friends
. please tell me when 1000 of clients request simultanuously
comes in struts , and 1000 of view page opens, tell me how may instance of ActionForm creates .

also tell me, is instance of ActionForm create after summiting resuest to ServletAction or at the time of framework loading.......
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The ActionForm instance is not threaded, so if your server receives 1000 HTML requests, 1000 instances of your ActionForm will be created.

However, if you specify "request" as the scope, each instance is available for garbage collection as soon as the server returns a response to the browser.

If you specify "session", you have only one instance per actual user of the system. If you're using session as the scope for any of your forms, it's wise to take steps to see that they're taken out of session scope as soon as the user moves on to another page. That way, at any given time, there is only one ActionForm per user in the session.

Consultant, Sima Solutions
I agree. Here's the link:
subject: instance of ActionForm
It's not a secret anymore!