Password Recovery Java
Could anyone please provide resources on how to do that in Java? I did search, but C sharp is more prevalent, so I bet java articles are really old and somewhere deep deep down. I am also using Spring, so if it has something in this area please identify. 

I know the general technique:

1. "Password recovery" button
2. Ask user to confirm its identity - via entering email.
3. Token is generated and send to mail adress. (how ? It is hash of what? which properties? how to send automatic mail message?-never done that before) 
4. User goes to token link provided, where new password field awaiting.

* Token has time validity, judging from other similar questions ideally few hours.
* Don't use security questions as they infinitely impractical.

What I am asking is some pseudo-code or example implementation in Java. Maybe OWASP has it - I didn't find though. Preference to Spring approach if it has something on it.
Password Recovery Java
===

Could anyone please provide resources on how to do that in Java? I did search, but C sharp is more prevalent, so I bet java articles are really old and somewhere deep deep down. I am also using Spring, so if it has something in this area please identify. 

I know the general technique:

1. "Password recovery" button
2. Ask user to confirm its identity - via entering email.
3. Token is generated and send to mail adress. (how ? It is hash of what? which properties? how to send automatic mail message?-never done that before) 
4. User goes to token link provided, where new password field awaiting.

* Token has time validity, judging from other similar questions ideally few hours.
* Don't use security questions as they infinitely impractical.

What I am asking is some pseudo-code or example implementation in Java. Maybe OWASP has it - I didn't find though. Preference to Spring approach if it has something on it.