struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Validator-How to put the fields value in the resulting error message?
Date Wed, 04 Feb 2004 00:05:40 GMT
I think you have to do this in code in your form's validate method.

errors.add(new ActionError(""), emailAddress);

I could be wrong but this is the way that I do it anyway... I'm not sure 
if the struts validator can do this using an expression like you have 
tried to do. 

Heya Gosper
CSC Australia
212 Northbourne Ave, Braddon ACT 2612
Ph: +61 (0) 2 6246 8155  Fax: +61 (0) 2 62468100
MOB: 0401 611779
This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.

"David Erickson" <>
04/02/2004 10:56 AM
Please respond to "Struts Users Mailing List"

        To:     "Struts Mailing List" <>
        Subject:        Validator-How to put the fields value in the resulting error message?

Hey all, still new with the validator.. I'm using the emailAddress 
and I just want it to put the value of the field in the error message if 
not valid.. ie:
blah! is not a valid email address.

however I can't seem to make that happen.. here's what I've tried:
<form name="/getPassword">

<field property="userName" depends="required">

<arg0 key="User Name" resource="false"/>


<field property="emailAddress" depends="required,email">

<arg0 key="${emailAddress}" resource="false"/>



and in my properties file<li>{0} is an invalid e-mail address.</li>



To unsubscribe, e-mail:
For additional commands, e-mail:

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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message