You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Michael J." <jm...@gmail.com> on 2005/04/20 20:08:52 UTC

Re: single action for multiple forms

If these are input pages, then who cares how many of them and what are
they. All they send to the server is an HTTP request. It is up to you
to build search expression out of it. That is the power of Struts
comparing to page-oriented event-driven frameworks ;) If you want to
accept input from these three pages only, and in a format, specific to
each page, then you need to distinguish the pages somehow.

DispatchAction is indeed a simple solution, just create buttons with
different names... er... VALUEs. but you are limited in naming your
button (if you do not want to use Javascript or image buttons),
because it should have the same VALUE (this is what displayed to a
user) as dispatch method.

If these are output pages, then you just stick them into <forward>
elements of your <action>.

Michael 

On 4/20/05, Fogleson, Allen <al...@daugherty.com> wrote:
> Yes. :)
> 
> Ok that  is the short answer. The longer answer is that yes you can do
> it but it could be almost as easy to have separate actions depending on
> how you are handling the actionForm(s). There is nothing in the
> framework however that disallows the use of a single action for multiple
> forms. Considering that in your case there will probably be more or less
> detail in the ActionForm and details returned I would probably consider
> a dispatchAction myself, but again that is personal preference.
> 
> Al
> 
> -----Original Message-----
> From: temp temp [mailto:miroconnect@yahoo.com]
> Sent: Wednesday, April 20, 2005 11:37 AM
> To: user@struts.apache.org
> Subject: single action for multiple forms
> 
> I have  three search pages (jsp) with different levels
> of search .
> All the three search pages use the same search engine
> to  get search results.
> Can I use a single action  for all these search pages.
> thanks & regards
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org