We want to do exaclty the same. After many attempts, it seems that Struts 1.1 Validator does not provide this functionality.
It seems that there will be an evolution in Struts 1.2 with the validwhen validator, see : "Designing Complex Validations with validwhen", http://jakarta.apache.org/struts/userGuide/dev_validator.html and http://jakarta.apache.org/struts/api/org/apache/struts/validator/validwhen/V alidWhen.html We are (will be) using intensively the Struts Validator and we do need this feature as soon as possible. If there are other people interested, maybe we can work together on the subject. First, let's write a short technical spec document, write a test class and then implement it ! As far I am concerned, we just need to extend FieldChecks to add the value of the field in the ActionError. Let me know what you think. Jean-Michel > -----Original Message----- > From: Daniel Wang [mailto:[EMAIL PROTECTED] > Sent: 16 September 2003 22:13 > To: Struts Users Mailing List > Subject: validator question: show value of a field in error > > > I asked this earlier and did not receive any response, so > i'll post it one > more time with more supporting info... > > In validation.xml, how do I show the value of the offending > field in the > error message as > opposed to the field name? > > i.e. if the field I want to validate is email, and the user > types in "foo", > how do I show > "'foo' is not a valid email address" > > as opposed to the more standard (or widely documented) error > "'Email Address' is not valid" > > In my current validation.xml, here's the relevant portion: > <field property="email" > depends="required,email"> > <msg > name="required" > key="errors.required"/> > <msg > name="email" > key="errors.bad.email"/> > > <arg0 key="testForm.email"/> > </field> > > > Thanks, > Daniel > > ________________________________________________________________________ This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com ________________________________________________________________________ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]