Password validation requirement
Hi all,
--> I got a pop up window in which some fields and Save button i s present. Password field also present in them.
Requirement:
When Password is changed, it has to be compared to the previous passwords in the Database. If matched wont accept, otherwise accept.
Problem to be solved:
The Jsp in which it is present is already directed to some other servlet thru form action attribute.
Where can i put my java validation code?
onclick of the save button, a javascript function is called in which some validations are written and if succed then submit() is called.
Can anyone please give some idea on how to do this?
Thanks
[690 byte] By [
JITHENDRAa] at [2007-11-27 6:36:47]

> Problem to be solved:
> The Jsp in which it is present is already directed to
> some other servlet thru form action attribute.
> Where can i put my java validation code?
> onclick of the save button, a javascript function is
> called in which some validations are written and if
> succed then submit() is called.
>
> Can anyone please give some idea on how to do this?
>
> Thanks
Well, there's no way to do this securely with JavaScript on the client side. I would do it in the servlet that the page is redirected to. Otherwise, you'll have to write the previous passwords (either plaintext or hashed) to the page so that they can be matched against.