You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Zoran Avtarovski <zo...@sparecreative.com> on 2007/04/24 09:02:53 UTC

[s2] Difference between actionMessages and actionErrors

A quick question on what the recommended method for displaying general
messages when using struts 2, actionMessages or actionErrors.

I had a look at the ValidationAware interface and there appears to be no
difference between the two.

The only difference I could see what that they are accessed by different
tags.

Which one is recommended? My main concern is are the non-obvious
implications of choosing one over another.

Z.



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


Re: [s2] Difference between actionMessages and actionErrors

Posted by Eric Rank <er...@lo-fi.net>.
Another important difference between ActionMessages and ActionErrors  
has to do with how the Validation interceptor works.

If you add an ActionError in the 'validate' method (or before the  
ValidationInterceptor get ahold of the request) of a ValidationAware  
action, the interceptor will see that there is some kind of error,  
and consequently, not fire the intended action method (execute by  
default). ActionMessages do not act that way. You can add  
ActionMessages without having an affect on the workflow of the action.

Eric Rank



On Apr 24, 2007, at 12:49 PM, Harring Figueiredo wrote:

> I was supposed to test the genereated HTML from both. (Laziness got  
> the best
> of me).
>
> <guess>
> Here it goes, without testing. I think that the HTML generated is  
> slightly
> different so that you
> may apply different CSS style sheets to it.
> </guess>
>
> harringf
>
> On 4/24/07, Musachy Barroso <mu...@gmail.com> wrote:
>>
>> <redundant>actionMessages is for general messages, and  
>> actionErrors for
>> errors.</redundant> . I don't think there are any implications.
>>
>> regards
>> musachy
>>
>> On 4/24/07, Zoran Avtarovski <zo...@sparecreative.com> wrote:
>> >
>> > A quick question on what the recommended method for displaying  
>> general
>> > messages when using struts 2, actionMessages or actionErrors.
>> >
>> > I had a look at the ValidationAware interface and there appears  
>> to be no
>> > difference between the two.
>> >
>> > The only difference I could see what that they are accessed by  
>> different
>> > tags.
>> >
>> > Which one is recommended? My main concern is are the non-obvious
>> > implications of choosing one over another.
>> >
>> > Z.
>> >
>> >
>> >
>> >  
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>


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


Re: [s2] Difference between actionMessages and actionErrors

Posted by Harring Figueiredo <ha...@gmail.com>.
I was supposed to test the genereated HTML from both. (Laziness got the best
of me).

<guess>
Here it goes, without testing. I think that the HTML generated is slightly
different so that you
may apply different CSS style sheets to it.
</guess>

harringf

On 4/24/07, Musachy Barroso <mu...@gmail.com> wrote:
>
> <redundant>actionMessages is for general messages, and actionErrors for
> errors.</redundant> . I don't think there are any implications.
>
> regards
> musachy
>
> On 4/24/07, Zoran Avtarovski <zo...@sparecreative.com> wrote:
> >
> > A quick question on what the recommended method for displaying general
> > messages when using struts 2, actionMessages or actionErrors.
> >
> > I had a look at the ValidationAware interface and there appears to be no
> > difference between the two.
> >
> > The only difference I could see what that they are accessed by different
> > tags.
> >
> > Which one is recommended? My main concern is are the non-obvious
> > implications of choosing one over another.
> >
> > Z.
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>

Re: [s2] Difference between actionMessages and actionErrors

Posted by Musachy Barroso <mu...@gmail.com>.
<redundant>actionMessages is for general messages, and actionErrors for
errors.</redundant> . I don't think there are any implications.

regards
musachy

On 4/24/07, Zoran Avtarovski <zo...@sparecreative.com> wrote:
>
> A quick question on what the recommended method for displaying general
> messages when using struts 2, actionMessages or actionErrors.
>
> I had a look at the ValidationAware interface and there appears to be no
> difference between the two.
>
> The only difference I could see what that they are accessed by different
> tags.
>
> Which one is recommended? My main concern is are the non-obvious
> implications of choosing one over another.
>
> Z.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd