struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hunt, Steve" <steve.h...@cgey.com>
Subject RE: Validation error messages
Date Mon, 02 Feb 2004 15:43:20 GMT
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:Scott.Glenn@umusic.com]
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: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message