Or... you can set Product object as nested property of an ActionForm,
and set ActionForm's scope to "session". The result is the same, but
seems more natural to me. You can render Product on JSP page, or
populate it from input (Struts will do it for you).

Michael

On 9/20/05, Jadeler <[EMAIL PROTECTED]> wrote:
> To better maintain all the data, I am opting not
> having alot of session variables but instead maintain
> one object that will contain all data needed and store
> that in a session.  For example, instead of having
> session.setAttribute("product", product),
> session.setAttribute("web_preference", webPreference),
> etc. just create an object like this which can then be
> stored in a session:
> 
> public class UserContainer{
>     private Product product;
>     private WebPreference webPreference;
> 
>     public Product getProduct () {
>         return product;
>     }
> 
>     public void setProduct(Product newProduct){
>         product= newProduct;
>     }
> }
> 
> and in the jsp page have something like this
> 
> <% UserContainer userContainer = (UserContainer)
> session.getAttribute(Constants.USER_CONTAINER_KEY); %>
> 
> Do you guys do something similar or any other
> recommendations?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to