FileDocCategorySizeDatePackage
CategoryAction.javaAPI DocJBoss 4.2.11815Fri Jul 13 20:56:06 BST 2007xpetstore.web.struts.action.category

CategoryAction

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

        CategoryForm  frm = ( CategoryForm ) form;
        String        categoryId = frm.getCategoryId(  );
        Petstore petstore = getPetstore(  );

        /* Category*/
        Category category = petstore.getCategory( categoryId );
        frm.setCategory( category );

        /* Items */
        Collection products = petstore.getProducts( categoryId, 0, Integer.MAX_VALUE ).getList(  );
        frm.setProducts( products );

        return mapping.findForward( SUCCESS );