This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes Validating password field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validating password field" Watch "Validating password field" New topic

Validating password field

Karthik Revanasiddan

Joined: Nov 24, 2006
Posts: 8

<field property="userLogin.password" depends="required,mask">
<msg name="mask" key="errors.invalid"/>
<arg0 key="userLogin.initialPassword"/>

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.

AmitV VermaV

Joined: Dec 08, 2006
Posts: 2

All regular expressions in the Struts mask rule must start with a ^ and end with a $.

And make sure that you define a "errors.password.maskMsg" in your file

errors.password.maskMsg= message.
[ December 08, 2006: Message edited by: AmitV VermaV ]
Nyanas Kandhan
Ranch Hand

Joined: Jan 27, 2009
Posts: 35
For an example on Mask Rule you can refer here. Struts Mask Validation Rule

Have you checked out Aspose?
subject: Validating password field
jQuery in Action, 3rd edition