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

SearchAction

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

        SearchForm    frm = ( SearchForm ) form;
        String        keyword = frm.getKeyword(  );
        Petstore petstore = getPetstore(  );

        Collection    products = petstore.searchProducts( keyword, 0, Integer.MAX_VALUE ).getList(  );
        frm.setProductValues( products );

        return mapping.findForward( SUCCESS );