Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6711269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:07:11+00:00 2026-05-26T08:07:11+00:00

Could anyone please provide resources on how to reset password in Java web application

  • 0

Could anyone please provide resources on how to reset password in Java web application connected to db where password stored as hashed(password+salt+secretphrase)? I am also using Spring, so if it has something in this area please identify.

I know the general technique:

  1. “Password reset” 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 webpage, 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 on how to generate tokens and send token mails to users.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:07:12+00:00Added an answer on May 26, 2026 at 8:07 am

    When you say java, do you mean web application in java ?
    Your functionality needs a lot of different components.

    • For the password recovery, add a button in jsp which makes a call to servlet. That servlet should redirect to a new jsp which has field to enter email.
    • Once the enter the email and submits. The request should go to another servlet which makes a db call and verifies the email. If the email is valid, then you can generate a token. Token can be generated by the Math.random() function. Generate some bunch of numbers and using those numbers create a string. e.g. for creating an all alphabet string divide the number by 26 and choose the character based on the remainder.
    • Finally another jsp page which allows choosing a new password.

    You can use JavaMail api for sending emails.
    Spring framework has many components, you can use it for frontend, DB calls and for sending mail. You need to go through the documentation to learn about them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could anyone please tell how jre directory help in the running java programs? I'm
could anyone please provide on how to achieve below scenario ? 2 queues -
Could anyone please provide an explanation of the syntax in the following example, or
Could anyone please provide me with guidance on whether it's possible to use aspNetActiveDirectoryProvider
Could anyone please tell what are the important use cases of IdentityHashMap ?
could anyone please clarify the meaning of line generalizes the tag object's storage of
Could anyone please tell me why the following line about filter init method invocation
could anyone please tell me, where in Javascript the difference between MyClass.prototype = new
Could anyone please tell me why the following casting is resulting in compile time
Could anyone please give a sample or any link that describes how to spawn

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.