Announcement Announcement Module
No announcement yet.
mail upon registration Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • mail upon registration

    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.

  • #2
    Maybe I'm not understanding exactly what you have in mind, but this seems pretty straightforward, actually:

    1) Collect registration data
    2) Generate unique identifier (look into java.util.UUID)
    3) email user with a link that looks like <some url>/<unique identifier>. Alternately it could be <some url>?id=<unique identifier>
    4) store registration data in database, keyed with unique identifier
    5) and you're done with this session

    Now, at some point (and it might be days later), the user clicks that link and generates a request. Most likely it's handled by a completely separate controller/portlet, and certainly a separate session. You pull the unique identifier out of the URL, look up the registration data based on that identifier, and create the account.

    Hope this helps!


    • #3
      Thanks Jacob.

      That answers most part of my question.

      My basic question is how to generate a URL within a portlet. In portal architecture, URL is not that simple if i understood correctly.

      How to generate a URL with the unique indetifier?

      PLs let me know the answer for this. THank you.

      I appreciate all your help.


      • #4

        You are right that using portlet urls is not possible. However, you can include a servlet within the same web application as your portlet which could be used to handle the registration confirmation requests.

        e.g. Send out a link to confirm the registration such as:<guid>


        portletwebapplication is the context root of the portlet web application on your application/portal server.

        confirmregistration is the url mapped in the web.xml of your portlet web application to a servlet to handle the registration confirmation.

        Of course, you could also package this as a separate application and deploy it on your portals application server. The advantage of including it within the same web application is you can share session information with portlets.

        In the past we have used this approach to allow a servlet to handle the incoming request and store information in the session and then redirect the user to a portal page (with a well known url) that contains a portlet. We then extracted the information from the portlet session (application scope) and prepopulated information into the form fields for the portlet (in formbackingobject).

        Hope this helps,



        • #5
          Thank you so much Chris.

          The information is really helpful .... i'm going to implement it in my portal. Thanks again.