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

  • Home
  • SEARCH
  • 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 146455
In Process

The Archive Base Latest Questions

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

When a user signs up in our Struts application, we want to send them

  • 0

When a user signs up in our Struts application, we want to send them an email that includes a link to a different page. The link needs to include a unique identifier in its query string so the destination page can identify the user and react accordingly.

To improve the security of this system, I’d like to first encrypt the query string containing the identifier and second set the link to expire–after it’s been used and/or after a few days.

What Java technologies/methods would you suggest I use to do this?

  • 1 1 Answer
  • 2 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. 2026-05-11T08:36:23+00:00Added an answer on May 11, 2026 at 8:36 am

    I’m going to make some assumptions about your concerns:

    1. A user should not be able to guess another user’s URL.
    2. Once used, a URL should not be reusable (avoiding session replay attacks.)
    3. Whether used or not, a URL shouldn’t live forever, thus avoiding brute-force probing.

    Here’s how I’d do it.

    • Keep the user’s ID and the expiration timestamp in a table.
    • Concatenate these into a string, then make an SHA-1 hash out of it.
    • Generate a URL using the SHA-1 hash value. Map all such URLs to a servlet that will do the validation.
    • When someone sends you a request for a page with the hash, use it to look up the user and expiration.
    • After the user has done whatever the landing page is supposed to do, mark the row in the database as ‘used’.
    • Run a job every day to purge rows that are either used or past their expiration date.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a sign up form that requires the user to enter their email
User click on a link button and it will direct them to a url
We want to integrate webmail with our current application. At present I need to
I have a HTML form, which includes radio buttons that the user can select
I have a sql database that stores some documents. A user can sign into
User equals untrustworthy. Never trust untrustworthy user's input. I get that. However, I am
If user input is inserted without modification into an SQL query, then the application
I have a rails application where each user has a separate database. (taking Joel
So we have reports which run, that our client runs multiple times daily and
I want to be able to log when a user ends their session on

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.