Niall

Thanks, that was an oversight that only happened in my quick mock-up.  I now
return the errors object, there is still no change is the request objects or
output.

Cheers

Christopher Marsh-Bourdon

-----Original Message-----
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: 21 April 2005 10:46
To: Struts Users Mailing List
Subject: Re: Validation's disappearing messages


You seem to be returning "null" from the ActioForm's validate method -
should be returning the ActionErrors - otherwise they won't get stored in
the request under the appropriate key.

Niall

----- Original Message ----- 
From: "Marsh-Bourdon, Christopher" <[EMAIL PROTECTED]>
Sent: Thursday, April 21, 2005 10:19 AM



> SimpleForm.java
>
>
> public ActionErrors validate(ActionMapping mapping,
> HttpServletRequest request)
> {
>
> // Perform validator framework validations
> ActionErrors errors = super.validate(mapping, request);
> if (errors == null)
> {
> errors = new ActionErrors();
> }
>
> if (getName() == null || getName().length() == 0)
> {
> errors.add("name", new
> ActionMessage("errors.required", "Name"));
> }
>
> if (getDescription() == null || getDescription().length() ==
> 0)
> {
> errors.add("description", new
> ActionMessage("errors.required", "Description"));
> }
>
> if (errors.size() > 0)
> {
> System.out.println("Errors: " + errors.size());
> StrutsHelper.outputRequestObjects(request);
> }
> return null;
> }
>



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


--------------------------------------------------------------------------------
The information contained herein is confidential and is intended solely for the
addressee. Access by any other party is unauthorised without the express
written permission of the sender. If you are not the intended recipient, please
contact the sender either via the company switchboard on +44 (0)20 7623 8000, or
via e-mail return. If you have received this e-mail in error or wish to read our
e-mail disclaimer statement and monitoring policy, please refer to 
http://www.drkw.com/disc/email/ or contact the sender. 3167
--------------------------------------------------------------------------------


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

Reply via email to