FileDocCategorySizeDatePackage
ProductAction.javaAPI DocJBoss 4.2.11787Fri Jul 13 20:56:04 BST 2007xpetstore.web.struts.action.product

ProductAction

public class ProductAction extends xpetstore.web.struts.action.BaseAction
author
Herve Tchepannou
struts.action
name="productForm" path="/product" scope="request" validate="false"
struts.action-forward
name="success" path="product.jsp"

Fields Summary
Constructors Summary
Methods Summary
protected org.apache.struts.action.ActionForwarddoExecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

see
xpetstore.web.struts.action.BaseAction#doExecute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)

        ProductForm   frm = ( ProductForm ) form;
        String        productId = frm.getProductId(  );
        Petstore petstore = getPetstore(  );

        /* Product */
        Product product = petstore.getProduct( productId );
        frm.setProduct( product );

        /* Items */
        Collection items = petstore.getItems( productId, 0, Integer.MAX_VALUE ).getList(  );
        frm.setItems( items );

        return mapping.findForward( SUCCESS );