You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ael <al...@dash.com.ph> on 2010/10/18 03:59:49 UTC

T5 Session State Add Cart.

Hello Everyone 

I just want to ask if this is the best practice for saving an add cart
function. Using SSO.
Need comments...

My code

Page Class

private List<String> item;

    @SessionState
    @Property
    private UserSession usersession;
    private boolean usersessionExists;

    Object onActivate(){

        if(item == null)
        item = new ArrayList<String>();

        temp.add(0, "item1");
        temp.add(1, "item2");
        temp.add(2, "item3");
        temp.add(3, "item4");

        usersession.setCart(item);

        return null;
    }


Session Class

private List<String> cart;

    public List<String> getCart() {
        return cart;
    }

    public void setCart(List<String> cart) {
        this.cart = cart;
    }

-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Session-State-Add-Cart-tp3216825p3216825.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org