Jonathan,

I think what you need here is a single pre-action that will set up
everything your search form needs.  For example:

public class ProjectSearchAction {

   public Resolution doPreSearch() {
      return new ForwardResolution( "/my_search_page.jsp" );
   }

   public Collection< String > getSearchFields() {
      // Make a call to loop through the projects and create
      // a collection of search fields
   }
}

Then, your JSP can look like this:

<s:form action="/ProjectSearch.action">
  <ol:class="search-grid smart-grid">
    <c:forEach items="${actionBean.searchFields}" var="searchField">
        <jsp:include page="fieldfragment.jsp">
          <jsp:param name="projectId" value="${searchField}"/>
        </jsp:include>
    </c:forEach>
  </ol>
</s:form>

-- Rick

On Tue, Jan 4, 2011 at 8:31 AM, Jonathan <jesuisjonat...@gmx.fr> wrote:

> The jsp:include works for simple case but if one of the main action bean
> parameters has the same name that a parameter of the included action bean
> there
> is a collision (for example an parameters named "entryId"). Another
> problem, if
> you use the inclusion in a loop (for example to render a line of a list) it
> also
> doesn't work since the action bean is cached and the action bean keep the
> first
> line state.
>
> Example, the fallowing jsp as a pre-action bean
> search.ProjectSearchFormAction :
>
> <s:form beanclass="search.ProjectSearchFormAction">
>    <ol class="search-grid smart-grid">
>        <c:forEach items="${actionBean.projects}" var="project">
>            <jsp:include beanclass="search.ProjectSearchItemViewAction"
> event="view">
>                <jsp:param name="projectId" value="${project.entryId}"/>
>            </jsp:include>
>        </c:forEach>
>    </ol>
> </s:form>
>
>
>
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment,
> and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to