• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question About The validation.xml

 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am new to Struts. I am working on the validation.xml.
I saw that date and email are pre-defined validators:

date - the field must be able to be cast to a date.
email - the field must contain a valid e-mail address

First, is it correct to do the following:

Second, what is the difference between:

and

I know the key is different. When do we use label.emailAddress and when do we use logonForm.emailAddress?
 
Junilu Lacar
Bartender
Posts: 7486
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on what you have in ApplicationResources.properties.
The key is used to look up a value in ApplicationResources.properties so you would use whichever key you need to display the desired error message.
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
date and email are pre-defined validators:

date - the field must be able to be cast to a date.
email - the field must contain a valid e-mail address

Is it correct to do the following?
 
Junilu Lacar
Bartender
Posts: 7486
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The definition looks OK. Did you try it and not have it work?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic