wood burning stoves 2.0*
The moose likes Struts and the fly likes validate two passwords in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validate two passwords in struts" Watch "validate two passwords in struts" New topic
Author

validate two passwords in struts

pingkan paula
Ranch Hand

Joined: Sep 03, 2004
Posts: 117
I'm new to struts and assigned to web project using struts and ibatis.
I want to validate two input where user must put their new passwords twice, the validation used to check whether the two new password are the same.
Anyone has a clue from where i should start? do i have to use validator framework?
Any feedbacks will be fully appreciated
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4445
    
    5

Why not keep it simple and use the ActionForm validate() method. Another alternative is to use JavaScript.

Closing this here and moving to Struts.


Junilu - [How to Ask Questions] [How to Answer Questions]
Henry Lowell
Ranch Hand

Joined: May 29, 2006
Posts: 63
If using Struts 1.2.something (basically when they added validwhen) in the validation.xml for your form:



Hank
pingkan paula
Ranch Hand

Joined: Sep 03, 2004
Posts: 117
I've tried using manual validation, but it returned NullPointerException errors, here is the validation code

Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
I am not sure why you are calling super.validate twice. If posisi_password_baru1 is null, then your code will throw a NullPointerException. You may want to add a check in your code. If you have a "required" check in your xml validation, then you may want to bracket your custom validation code with an " if (errs.isEmpty())" check.

- Brent
jaisai vijay
Ranch Hand

Joined: Dec 17, 2009
Posts: 70
Hello Henry Lowell,

I am using struts 1.2 and I have tried with the example you provide.

My code is like the following

I have three fields
currentpassword
newpassword
confirmpassword

Now I need to compare with new and confirpassword

I have written code like



I did not get any pop up when those two are not same. What would be the mistake in that?

Thanks for your help in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: validate two passwords in struts
 
Similar Threads
How to valdate password and confirm password using validation framework in struts2?
Validate method
how to include usernames and password in com.tagish. passwd file
Validator Framework - Can we use same ActionForm for two different UI ?
Regarding: Encryption of Password in Oracle