Nothing wrong with that approach at all; that's why forward() exists.
However, a lot of folks prefer to use the <result /> in the XML so that
there is a "more accurate" roadmap of application flow all in one file
(MG.xml).  Of course, though, once your application becomes complex enough
to have multiple XML files the "roadmap" benefit is somewhat negligible.
YMMV.  :-)


On Wed, Aug 31, 2011 at 7:41 AM, Rawlins <[email protected]> wrote:

> Hello Guys,
>
> I've been thinking about this over the past couple of hours,
> and coincidentally found this related thread.
>
> I agree with Sean & Chris that I feel a little uncomfortable with the
> addResult() method and the way you don't really have an insight as to what
> is going on when it's called.
>
> My question would be, what's the downside to using the forward() method
> directly within the controller when you want to perform these kinds of
> actions?
>
> Take a simple form validation example.
>
> function someFormControllerMethod( ... ) {
>     if ( validates ) {
>
>         ...event.forward("my.success");
>
>     } else {
>         ...event.forward("my.form");
>     }
> }
> This gives you the same effect as the result with redirect=true does it
> not? but with a more explicit definition of what's going on actually in the
> controller, rather than in the XML.
>
> Is their anything wrong with this approach?
>
> Robert
>
> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en
>

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to