struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gaffer <gaf...@cox.net>
Subject RE: Does Struts automatically populate an actionForm in session scope??
Date Tue, 25 Mar 2003 16:22:13 GMT
Click, I think the light bulb just went on.So, in general the sequence
is something like this???????

1. A user requests a form
2. Struts creates a session actionForm (based on scope setting in action
map) 
3. ??? Does the first jsp need <jsp:usebean scope="session" name="x" />
or does Struts know that the bean is in session scope? Does Struts put
the sessionid inside the form?
4. User submits form for first time and Struts populates the actionForm
parameters
5. action gets form, if access to form data is needed use
request.getSession() and modify as needed.
6. return mapping.findforward("sucess")
7. The next page has to have <jsp:usebean scope="session" name="x" />
8. The user adds/modifies data and submits form.
9. Struts does NOT populate actionForm
10. action has to HttpSession session = request.getSession();
session.getAttibute(attributename) or session.setAttribute(attibutename)
11 repeat 7-10 as needed.



On Tue, 2003-03-25 at 00:53, shirishchandra.sakhare@ubs.com wrote:
> the autopopulation mechanism of struts will look for properties of beans whihch are same
as the parameters u have sent..so do u have this condition met?
> 
> And in case of session scope form, the auto population will be caled only first time...thats
the whole point of using session scope..i mena to preserve the data..
> 
> -----Original Message-----
> From: gaffer [mailto:gaffer@cox.net]
> Sent: Tuesday, March 25, 2003 12:55 AM
> To: struts-user@jakarta.apache.org
> Subject: Does Struts automatically populate an actionForm in session
> scope??
> 
> 
> Good Afternoon,
> 
> Any insight would be most appreciated as I can't seem to get an
> actionForm to automatically populate in session scope. 
> 
> I am assuming that Struts manages beans regardless of scope.
> 
> Proper conditions for setting and getting an actionForm in session scope
> are ?????
> 
> actionForm scope in struts-config is set to "session"
> actionForm implements java.io.Serializable
> empty constructor for actionForm
> request.getSession() for accessing parameters
> 
> If the actionForm is in scope, I should see the sessionid appended to
> the uri in the form?
> 
> I have added a System.out.println to a couple of setters in the bean to
> see when it is getting populated, but nothing happens when the form is
> submitted.
> 
> Many thanks for your valuable time.
> Al
-- 
gaffer <gaffer@cox.net>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message