protected org.apache.struts.action.ActionForward | doExecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
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 );
|