Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Displaying error values with Struts Validator Framework

Reply
Thread Tools

Displaying error values with Struts Validator Framework

 
 
smrimell@gmail.com
Guest
Posts: n/a
 
      01-07-2007
Hi,

I'm using the struts validator framework to validate an email address
in a form.
If the user enters an invalid email address (ie
invalidEmailAddress.com) I'd like to display the following error
message:-

"invalidEmailAddress.com is an invalid e-mail address"

However all I seem to be able to do with the validator framework is
output the following:-

"Email address is an invalid e-mail address"

with messageResources.properties and validator.xml set as follows:-

validator.xml:-
<form name="addressForm">
<field property="emailAddress"
depends="email">
<msg name="email" key="errors.email" />
<arg name="email" key="form.address.label.emailAddress" />
</field>
</form>

messageResources.properties:-
errors.email={0} is an invalid e-mail address.
form.address.label.emailAddress=Email address

I'm using <html:errors /> to output the error list in a jsp.

Is there any way to substitute the actual entered value into the
errors.email message using the struts validator framework? I know it
can be done in the validate() method of the ValidatorForm class but
it there method of simply using the validator framework?

Thanks in advance for your help.
smrimell.

 
Reply With Quote
 
 
 
 
relogout@gmail.com
Guest
Posts: n/a
 
      01-08-2007
i don't think it's possible except using validate() method

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Struts Validator Framework Prashant Java 1 03-15-2007 12:27 PM
Struts Validator - creditCard validator smrimell@gmail.com Java 4 02-13-2007 08:32 PM
Struts validator framework: help with jsp pages aerotops Java 1 02-24-2006 10:45 AM
Struts validator framework: help with jsp pages aerotops Java 0 02-22-2006 05:47 PM
Validator Struts Framework Sergio Java 0 05-03-2004 06:12 PM



Advertisments