Check out Action.saveErrors for saving the errors returned from your call to 
validate:

saveErrors(request, null); // clear current errors if you want
ActionErrors er = form.validate(mapping, request);
if ((er != null) && (!er.isEmpty())) {
  saveErrors(request, er);
  forward = new ActionForward(mapping.getInput());
}

Quoting Wendy Smoak <[EMAIL PROTECTED]>:

> 
> Because I need to allow the user to come and go from the form before the
> "final" submit, I need to hold off on validation until that point.  So I've
> got validate="false" (that was a gotcha!) in the <action> tag and I'm now
> in
> my LookupDispatchAction doing the validation manually:
> 
> How does this look?
> 
>       request.removeAttribute("org.apache.struts.action.ERROR");
>       ActionErrors er = ((ContactForm) form).validate(mapping, request);
>       if ( !er.isEmpty() ) {
>          request.setAttribute("org.apache.struts.action.ERROR", er);
>          return ( mapping.findForward( "edit" ) );
>       }
> 
> Can someone point me to where in the struts source code this is done
> "automatically" when validate is set to true in the <action> tag?  I've
> grepped through the source code for 'ERROR' but there was too much!
> 
> Thanks,
> 
> -- 
> Wendy Smoak
> http://sourceforge.net/projects/unidbtags 
> 


-- 
Kris Schneider <mailto:kris@;dotech.com>
D.O.Tech       <http://www.dotech.com/>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to