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 556055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:52:46+00:00 2026-05-13T11:52:46+00:00

I need to verify the email. I want to do it by generating a

  • 0

I need to verify the email. I want to do it by generating a unique string and making a link of it for users to click on it in the mail.

I don’t know how to generate it using Java.

There are md5, sha1, etc functions in php to generate the string using any unique value like email. Is there same function provided in jsp?

  • 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-13T11:52:46+00:00Added an answer on May 13, 2026 at 11:52 am

    One way encryption tools like MD5/SHA/etc does not necessarily generate unique strings. Two different strings can namely generate the same hash. That’s after all also the whole idea behind one-way encryption: there’s no (reliable) way to find out what the original string was.

    Better make use of java.util.UUID, if necessary in combination with a database PK or UK so that you can just generate a new one in case of an (unexpected) constraint violation.

    Here’s a basic example how to get such a random unique key:

    String key = UUID.randomUUID().toString();
    

    That said, JSP is a view technology. You aren’t supposed to write raw Java code in JSP files. Use taglibs and EL in JSP only. With taglibs you can control the page flow and with EL you can access backend data. Keep raw Java code in Java classes like servlets, filters, beans, etc.

    In this specific case, just have a JSP with a HTML form which submits to some (controller) servlet which in turn generates the key using java.util.UUID, stores it in the DB using the JDBC API, sends an email using the JavaMail API and finally forwards the request to some result JSP.

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

Sidebar

Related Questions

I need to verify if given URL matches my domain mask. Example: I want
I am having an ASP.net Membership I need to verify the User Question and
I'm using browser automation for testing web sites but I need to verify HTTP
I'm using browser automation for testing web sites but I need to verify HTTP
I need some easy API to verify that a PE file is valid &
I need to construct the URL of a page in a String, to send
I need to verify an /etc/passwd file is valid, and thought regex would be
i need to verify if the password is correct for a user. i have
I need to verify my form information and send an acknowledgement page. This is
Need a function that takes a character as a parameter and returns true if

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.