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

UpdateCardAction

public class UpdateCardAction extends BaseCartAction
author
Herve Tchepannou
webwork.action
name="updateCart" success="cart.action"

Fields Summary
private String[]
_itemId
private int[]
_quantity
Constructors Summary
Methods Summary
protected java.lang.StringdoExecute()

see
webwork.action.ActionSupport#doExecute()

        Map cart = getCart(  );

        for ( int i = 0; i < _quantity.length; i++ )
        {
            int qty = _quantity[ i ];

            if ( qty <= 0 )
            {
                cart.remove( _itemId[ i ] );
            }
            else
            {
                cart.put( _itemId[ i ], new Integer( qty ) );
            }
        }

        return SUCCESS;
    
public java.lang.String[]getItemId()

return
String[]

        return _itemId;
    
public int[]getQuantity()

return
int[]

        return _quantity;
    
public voidsetItemId(java.lang.String[] itemId)
Sets the itemId.

param
itemId The itemId to set

        _itemId = itemId;
    
public voidsetQuantity(int[] quantity)
Sets the quantity.

param
quantity The quantity to set

        this._quantity = quantity;