struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: Session Objects
Date Thu, 01 Mar 2001 22:50:55 GMT
Palamadai Sriram wrote:

> I am caught sometimes in a dilemma whether to use Session attributes or
> request attributes. I know the difference between the 2 but is there is a
> big improvement in performance if we choose one over the other?

In terms of access speed, there is essentially no difference -- request
attributes and session attributes are both typically stored in a Hashtable or
something like that.

The difference, in a Struts application, shows up only when you have a form
bean that spans more than one page.  In those cases, you will need to send
all the fields from other pages along as hidden variables, in order to
maintain state.  For a single-page form (which is the typical case), request
scope and session scope have essentially the same semantics -- but request
scope will provide a potential performance improvement because memory will
not be occupied by form bean objects in between requests.

Craig



Mime
View raw message