FileDocCategorySizeDatePackage
ItemAction.javaAPI DocJBoss 4.2.11731Fri Jul 13 20:56:06 BST 2007xpetstore.web.struts.action.item

ItemAction

public class ItemAction extends xpetstore.web.struts.action.BaseAction
author
Herve Tchepannou
struts.action
name="itemForm" path="/item" scope="request" validate="false"
struts.action-forward
name="success" path="/item.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)

        ItemForm      frm = ( ItemForm ) form;
        String        itemId = frm.getItemId(  );
        Petstore petstore = getPetstore(  );

        /* Item */
        Item item = petstore.getItem( itemId );
        frm.setItem( item );

        /* Product */
        Product product = petstore.getProductByItem( itemId );
        frm.setProduct( product );

        return mapping.findForward( SUCCESS );