File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Portals and Portlets and the fly likes mail upon registration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "mail upon registration" Watch "mail upon registration" New topic

mail upon registration

Laxmi Raghu
Ranch Hand

Joined: Feb 16, 2005
Posts: 218
I'm developing a social networking portal using spring framework.

I have the following requirement.

A user who is willing to join this social networking portal will fill up a online form and clicks 'Submit' button. Upon clicking submit button, i need to send an email to the email id provided during registration with a link to visit. Once user sees the email, he visits the link provided and then user account is created with data provided during registration.

Now my problem is i'm unable to come with some web link that i can provide in the email upon registration.

How to form a link with user data provided in a portlet?

Where should i keep that registration data (in session or ???)

I'm not clear on how to implement this logic. Can anybody give me insight on how to implement the above mentioned logic?

Any help will be highly appreciated.

Thank you.
Edit/Delete Message
Dharmesh Chheda
Ranch Hand

Joined: May 08, 2001
Posts: 204
I am just throwing out the idea.

What you can do is have a table in the database that will hold the data the user entered in the form. So once the the user clicks the submit form, capture all the data in the table and use the generated key as an identifier.

Append the generated key as a request parameter (within the URL).. so when the user (at his/her own convenience) clicks on the link in the email, fetch all the previously stored data based on the id and proceed.

-- You can come up with an encrypting logic to encrypt the identifier so that no user will play around with it.

does this make any sense?

regards,<br />Dharmesh Chheda
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
The approach is sound, but you absolutely, positively must encrypt the identifier. Or, even better, make it a hash of the ID and some lengthy "salt" string, which you then also store in the database. If the URL is then accessed you can extract that identifier and retrieve the record in the database that goes with it.

It's also common that the URL only has a limited validity (maybe 24 hours or so). After that, a new one must be generated.
I agree. Here's the link:
subject: mail upon registration
It's not a secret anymore!