• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Struts validator Framework

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Karthik Revanasiddan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>[..reg-expression...]</var-value>
</var>
</field>

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

regards,
karthik.
 
Whatever you say buddy! And I believe this tiny ad too:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic