File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts validator Framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts validator Framework" Watch "Struts validator Framework" New topic
Author

Struts validator Framework

Karthik Revanasiddan
Greenhorn

Joined: Nov 24, 2006
Posts: 8
Hi all,

How do i validate the password field using mask rule. When I apply required and mask rule to the password field the required rule works but the mask rule does not work. How do i validate the password field
Am using <html assword/> tag.

regards,
karthik.
Rama Krishna Ghanta
Ranch Hand

Joined: Nov 20, 2006
Posts: 59
Karthik,

Let us know the mask rule you are using.If you use like mentioned below, then the password field will accept only alphabets in both Upper and Lower case.

<field property="newpassword" depends="required,minlength,maxlength,mask">
<arg0 key="prompt.password"/>
<arg1 key="${var:minlength}" name="minlength" resource="false"/>
<arg2 key="${var:maxlength}" name="maxlength" resource="false"/>
<var>
<var-name>minlength</var-name>
<var-value>6</var-value>
</var>
<var>
<var-name>maxlength</var-name>
<var-value>12</var-value>
</var>
<arg3 key="${var:mask}" name="mask" resource="false"/>
<var>
<var-name>mask</var-name>
<var-value>^[a-zA-Z]+$</var-value>
</var>
</field>


Regards,
Rama Krishna Ghanta


Ram...
Karthik Revanasiddan
Greenhorn

Joined: Nov 24, 2006
Posts: 8
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>[..reg-expression...]</var-value>
</var>
</field>

In the above mentioned way I have mapped the password field to mask rule

regards,
karthik.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts validator Framework