in the resource file where the error message is defined use {0} to
parametize it.
eg
address.invalid=Address {0} is not a valid email address.

When you construct the actionError add the parameter to the constructor ie.
new ActionError("address.invalid", address)

Regards
Steve

-----Original Message-----
From: Glenn, Scott [mailto:[EMAIL PROTECTED]
Sent: 02 February 2004 14:45
To: 'Struts Users Mailing List'
Subject: Validation error messages


I might be missing something obvious here, but is there an easy way to get
the submitted value to become part of the your error message?

So, for example, if the user enters "abc" in an email field, I'd like a
message saying :-

        Address "abc" is not a valid email address.

I can get this behaviour when I write my own custom validation routines, but
what about the base Struts validation rules ... can they be configured to
display the entered value, as opposed to a string from the AppResources
bindle?

Cheers,

Scott.


 


=======================================================
This message contains information that may be privileged or confidential and is the 
property of the Cap Gemini Ernst & Young Group. It is intended only for the person to 
whom it is addressed. If you are not the intended recipient, you are not authorised to 
read, print, retain, copy, disseminate, distribute, or use this message or any part 
thereof. If you receive this message in error, please notify the sender immediately 
and delete all copies of this message.
=======================================================


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

Reply via email to