The first parameter of your addErrors method should be either
ActionErrors.GLOBAL_ERROR (if the error is not associated with a specific
form property) or the name of the form property the error is associated
with (say "socialSecurityNumber").  It sounds like the error you are trying
to create is a global one, so you should probably set it to
ActionErrors.GLOBAL_ERROR.

The <html:errors> tag should be capable of displaying global errors, but
someone else may have to address that - we created our own custom tags to
display error messages rather than using the ones that came with Struts
taglib.

Jim Weaver
Software Developer - ThoughtWorks
[EMAIL PROTECTED]


                                                                                       
                                  
                      "Mark Kaye"                                                      
                                  
                      <[EMAIL PROTECTED]        To:       "Struts Users Mailing List" 
<[EMAIL PROTECTED]>    
                      >                        cc:                                     
                                  
                                               Subject:  RE: [Newbie] Another silly 
question                             
                      08/30/2002 11:45                                                 
                                  
                      AM                                                               
                                  
                      Please respond to                                                
                                  
                      "Struts Users                                                    
                                  
                      Mailing List"                                                    
                                  
                                                                                       
                                  
                                                                                       
                                  




> -----Original Message-----
> From: Mark Kaye
>
> Can I use ActionErrors in my actions?  Rather than in my
> ActionForms?  I have tried but it causes an error.

Actually, I've just tried again and it's still not working but doesn't
now cause an error. Hmm.

What's wrong with this code in my Action?

ActionErrors errors = new ActionErrors();
errors.add("Failure",new ActionError("error.login.id.failure"));

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







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

Reply via email to