Typically, I will create a SearchBean with all of the search parameters on it. Included in this bean is a collection to store the results in.

On the ActionForm, I will include the SearchBean as a parameter on the search bean. On the JSP, I use nested tags or the . notation (<html:text property="search.name"...) That way I can pass the SearchBean to a Dao Helper, ActionForm, or Business Logic Utility with a single get/set method.


Inactive hide details for "Mitchell, Steven C" <[EMAIL PROTECTED]>"Mitchell, Steven C" <[EMAIL PROTECTED]>


          "Mitchell, Steven C" <[EMAIL PROTECTED]>

          07/08/2005 08:34 AM

          Please respond to
          "Struts Users Mailing List" <user@struts.apache.org>

To

<user@struts.apache.org>

cc


Subject

Passing data between action forms

I'm curious to hear what other people are doing regarding the passing of
data between actions.  Take for example an advanced search page with
validation, drop down lists, the works.  Upon successful validation the
user should flow to a search results page.  Assume the results page is
part of something bigger that may require additional server-side
processing.  

In the past I have put the search results list on the same action form
as the search criteria and just forwarded to a different JSP from the
same action.  There are times when I would prefer to forward to a
different action/form pair, especially if their is potential for
additional processing.  I suppose I could put the form in the session
and define a different action that uses the same form to achieve some
modularity, but I would prefer to be able to just hand-off the search
results to a separate action/form pair.  Is there an elegant way to do
that in Struts?  Am I just trying to make this overly complex?

Reply via email to