FileDocCategorySizeDatePackage
AddItemAction.javaAPI DocJBoss 4.2.11230Fri Jul 13 20:55:42 BST 2007xpetstore.web.webwork.action.cart

AddItemAction

public class AddItemAction extends BaseCartAction
author
Herve Tchepannou
webwork.action
name="addItem" success="cart.action"

Fields Summary
private String
_itemId
Constructors Summary
Methods Summary
protected java.lang.StringdoExecute()

see
webwork.action.ActionSupport#doExecute()

        Map     cart = getCart(  );
        Integer qty = ( Integer ) cart.get( _itemId );

        if ( qty == null )
        {
            cart.put( _itemId, new Integer( 1 ) );
        }
        else
        {
            cart.put( _itemId, new Integer( 1 + qty.intValue(  ) ) );
        }

        return SUCCESS;
    
public java.lang.StringgetItemId()

return
String

        return _itemId;
    
public voidsetItemId(java.lang.String itemId)
Sets the itemId.

param
itemId The itemId to set

        _itemId = itemId;