Re: ActionError in Struts 1.2.7

2005-05-27 Thread Niall Pemberton
In the Action there are two convenience methods:

 saveErrors(request, ActionMessages)
 saveMessages(request, ActionMessages)

You cn use the saveMessages() method to store under the messages key.

Niall

- Original Message - 
From: "David Johnson" <[EMAIL PROTECTED]>
Sent: Friday, May 27, 2005 5:13 AM

> This opens up the possibility of having errors and messages both stored
> using saveerrors( request, ActionMessages) but what I'm wondering what
> method you'd recommend for separating them?
>
>  I'm using this to display my errors in my jsp:
> 
>
>  
>
> but it wouls seem to make more sense to have perhaps two areas in my JSP,
> one reserved for "errors" and one for "messages", like this:
>
>
>   
>
>
>
>   
>
>
>  it would seem that "saveErrors()" saves everything unser the "msg" key by
> default.
>
> Is there any way do override that behavior to store it under a key that
> makes more sense (i.e. I'm saving "errors" under the key=msg which seems
> sketchy)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ActionError in Struts 1.2.7

2005-05-26 Thread David Johnson
Niall
 Related to this, I found your article 
http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html VERY 
helpful ant informative. I've refactored my application (yes it's midnight 
in NY) to REMOVE all ActionError references (leavinf the ActionErrors in the 
validate() as you recommend.
 I have a question though
 This opens up the possibility of having errors and messages both stored 
using saveerrors( request, ActionMessages) but what I'm wondering what 
method you'd recommend for separating them?
 I'm using this to display my errors in my jsp:
  
 
 
 but it wouls seem to make more sense to have perhaps two areas in my JSP, 
one reserved for "errors" and one for "messages", like this:
 
 
 
 
 
 
 it would seem that "saveErrors()" saves everything unser the "msg" key by 
default.
 Is there any way do override that behavior to store it under a key that 
makes more sense (i.e. I'm saving "errors" under the key=msg which seems 
sketchy)
 I understand that I can do this:
ActionMessages am = new ActionMessages(); 
am.add( ActionMessages.GLOBAL_MESSAGE, 
new ActionMessage( "msg.warning" ) ); 
request.setAttribute("warnings", am); 
 but it FEELS like a workaround
 thoughts?
 On 5/26/05, David Johnson <[EMAIL PROTECTED]> wrote: 
> 
> tyvm :> 
> 
> On 5/26/05, Niall Pemberton <[EMAIL PROTECTED]> wrote: 
> > 
> > It was deprecated in Struts 1.2.4 - theres info about this in the wiki:
> > 
> > http://wiki.apache.org/struts/StrutsUpgradeNotes11to124
> > http://wiki.apache.org/struts/StrutsDeprecatedActionErrors
> > 
> > Niall
> > 
> > - Original Message - 
> > From: "David Johnson" <[EMAIL PROTECTED]>
> > Sent: Friday, May 27, 2005 2:48 AM
> > 
> > 
> > I notice that ActionError is deprecated in this version.. is there some 
> > document describing what we should now be doing?
> > 
> > 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED] 
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> -- 
> -Dave
> [EMAIL PROTECTED] 




-- 
-Dave
[EMAIL PROTECTED]


Re: ActionError in Struts 1.2.7

2005-05-26 Thread David Johnson
tyvm :>

On 5/26/05, Niall Pemberton <[EMAIL PROTECTED]> wrote: 
> 
> It was deprecated in Struts 1.2.4 - theres info about this in the wiki:
> 
> http://wiki.apache.org/struts/StrutsUpgradeNotes11to124
> http://wiki.apache.org/struts/StrutsDeprecatedActionErrors
> 
> Niall
> 
> - Original Message -
> From: "David Johnson" <[EMAIL PROTECTED]>
> Sent: Friday, May 27, 2005 2:48 AM
> 
> 
> I notice that ActionError is deprecated in this version.. is there some
> document describing what we should now be doing?
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
-Dave
[EMAIL PROTECTED]


Re: ActionError in Struts 1.2.7

2005-05-26 Thread Niall Pemberton
It was deprecated in Struts 1.2.4 - theres info about this in the wiki:

http://wiki.apache.org/struts/StrutsUpgradeNotes11to124
http://wiki.apache.org/struts/StrutsDeprecatedActionErrors

Niall

- Original Message - 
From: "David Johnson" <[EMAIL PROTECTED]>
Sent: Friday, May 27, 2005 2:48 AM


 I notice that ActionError is deprecated in this version.. is there some 
document describing what we should now be doing?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ActionError in Struts 1.2.7

2005-05-26 Thread David Johnson
Hi all
 I notice that ActionError is deprecated in this version.. is there some 
document describing what we should now be doing?
  [javac] 
C:\Builds\riskGrid\src\com\company\struts\form\QueryResultsForm.java:101: 
warning: org.apache.struts.action.ActionError in
org.apache.struts.actionhas been deprecated
[javac] errors.add( ActionErrors.GLOBAL_ERROR, new ActionError("
error.thing.duplicate.name ") );
 
-- 
-Dave
[EMAIL PROTECTED]