This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validating password field

 
Karthik Revanasiddan
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

<field property="userLogin.password" depends="required,mask">
<msg name="mask" key="errors.invalid"/>
<arg0 key="userLogin.initialPassword"/>
<var>
<var-name>mask</var-name>
<var-value>^[a-zA-Z]+$</var-value>
</var>
</field>

In the above mentioned way I have mapped the password field to required rule and mask rule. The required rule is applied to the password field but the mask rule is not applied when i click the submit button.

regards,
karthik.
 
AmitV VermaV
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


All regular expressions in the Struts mask rule must start with a ^ and end with a $.
<var>
<var-name>mask</var-name>
<var-value>^[a-zA-Z0-9]*$</var-value>
</var>

And make sure that you define a "errors.password.maskMsg" in your MessageResources.properties file
e.g

errors.password.maskMsg= message.
[ December 08, 2006: Message edited by: AmitV VermaV ]
 
Nyanas Kandhan
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For an example on Mask Rule you can refer here. Struts Mask Validation Rule
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic