struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dakota Jack <dakota.j...@gmail.com>
Subject Re: Coupling, Struts and JSF
Date Tue, 04 Jan 2005 17:33:46 GMT
Why not just create a helper class common to the two actions and not
chain a third action?  Likewise, if this is the main difficulty, why
not just follow through on divorcing the form and the action?  That
would be GREAT!

Jack


On Tue, 4 Jan 2005 10:44:11 -0500, Sean Schofield
<sean.schofield@gmail.com> wrote:
> > A use case is:
> >
> > - Two struts actions (say CreateAction and EditAction call the same jsp
> > to view the result (say result.jsp).
> > - This result.jsp needs some setup (eg. a list of items for a selection
> > box).
> > - The natural way to populate such a list in struts, is in the action.
> > - To prevent having the logic to populate the list both in CreateAction
> > and in EditAction,
> >  some users create a new ResultAction, where they do the view
> > preparation.
> > - Then they chain the action (this is controversal stuff):
> >  . In CreateAction they do creation logic, and than forward to
> > ResultAction.
> >  . In EditAction they do edit logic, and than forward to ResultAction.
> >
> > As discussed in bug 16107:
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16107
> 
> I guess JSF deals with this by having a single jsf page that has a
> single "backing bean" to populate itself.  Right?
> 
> I suppose one implication of this is that the logic necessary to
> "populate" a page is coupled with the page itself (or at least the
> choice of logic).  There's probably not really a way to avoid this.  I
> guess Struts really does this too but the binding takes place in
> struts-config.xml.  The more that I think about it, it's easier to
> find the logic in the page itself instead of hunting around
> struts-config looking for it. :-)
> 
> > Regards, Jan
> 
> sean
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 
> 


-- 
------------------------------

"You can lead a horse to water but you cannot make it float on its back."

~Dakota Jack~

"You can't wake a person who is pretending to be asleep."

~Native Proverb~

"Each man is good in His sight. It is not necessary for eagles to be crows."

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

-----------------------------------------------

"This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation."

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


Mime
View raw message