struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frederic Dernbach <>
Subject Best Practice : session vs. request attributes
Date Thu, 06 Nov 2003 17:37:24 GMT
I'm questioning my current design practice regarding Struts forms.

Until now, I tend to store all client data in the Struts form and I
avoid using other request attributes or session attributes.

But, this approach seems limited when I need to display a collection of
objects that are "very polymorphic". Let's say I need to display a
collection of instances of different classes A1, A2 and A3, that all
extend the same parent class A. A1, A2 and A3 have a very limited number
of common properties (described in class A).

If I store the collection of A's in the Struts form (as in indexed
property), I do not know to to code a <logic:iterate> tag in the JSP in
order to make sure that I won't loose data from request to request (what
preoperty attribute can I write for this tag ?) :
<logic:iterate 	name="myForm"

Therefore, in this case, I want to use a session attribute to store the
collection of As. Of course I won't loose client data from request to
request (action forward).

What is your point of view regarding this matter ?

Is it OK using session attributes (performance, memory, etc. ), even if
you make sure session attributes are removed when no more needed ?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message