Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

how to check two fields are similar in struts?

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i has a form for password change.

i check that new password field and confirm new password field has equal values or not in automatic validation in struts.


any one tell me what am i do for this checking.
i am waiting , thanks advance.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two ways you can accomplish this:

Method 1: override the validate method on your form bean. In that method, you would first call super.validate() to perform the validation framework validations, and then write your own logic to compare the two fields.

Method 2: Create your own validation rule that compares two field. Fortunately for you, the Struts Validator Guide provides an example of the very thing you're trying to do in the section entitled Pluggable Validators.
 
shahidrasul shahid
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks my problem is solve by validwhen validator.
 
The City calls upon her steadfast protectors. Now for a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic