Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Password validation using struts?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem. I am coding for a registeration page using struts and in password field I have to check whether the characters are in 0-9, a-z , A-Z. But the constraint here is the user must have one in each group i.e., one numberic, one lower case and one upper case. The code I have written here is below. I know it is checking either of these group, but how to make this code to fit for the constraint. Please help me , it urgent!!
Thanks in advance.


<field-validator type="regex">
<param name="expression">^[0-9a-zA-Z]*$</param>
<message>Password</message>
</field-validator>
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this case I think you need to overide the validate method in Action and implement checking logic in code.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You *could* use a regex for this, but I agree with the original poster--I'd use Java-based validation for this, as it's likely the logic would need to be re-used elsewhere in the application.
 
Hey cool! They got a blimp! But I have a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic