• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Activate Account by clicking url in email

 
Ranch Hand
Posts: 85
Eclipse IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


i have one registration page.In the button click event(submit) when user click on submit button a confirmation mail should be sent to the User. User should confirm mailid by clicking on link sent in mail. .
On click of link in email or on copy/paste activate account ( Redirect to activation page)
This link shall expire after clicking once. please suggest me .



I have send the mail. its work fine. but can some one suggest method to activate Account by clicking the link. I am using spring,jsf, jpa,jboss.

Thanks in advance...
 
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
During the registration you create a random activation key that you save somewhere (e.g. database). Your activation controller (the one that is called when the user clicks the link) search in the database for this activation key and if it's found mark the user with a flag as 'activated'. If it's not found (or the activation-flag is already set), show an error message.
 
pradeep gamage
Ranch Hand
Posts: 85
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Joachim Rohde,

when the user register with my application I am storing 0 as activation code in database and same time sending mail to that user.

what i have to know is that,

how to change that activation code 0 to 1 by clicking url in email.

Thanks in advace...
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You include the activation key (which needs to be unique as well as random) as a parameter in the URL in your mail.
 
pradeep gamage
Ranch Hand
Posts: 85
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes.. In email , i am sending this link "http://localhost:8080/prototype5JTA/faces/activate.jsp?activate=1&acid=70"; . so when user click this link in email. i want get that activate id and cid. if i can get those in to jsf manage bean i can update database. any suggestions ?

Thanks in Advance
 
Sheriff
Posts: 21997
107
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
request.getParameter("activate") and request.getParameter("acid") in your JSP file?
 
pradeep gamage
Ranch Hand
Posts: 85
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.. But when user click email link in email from server side i have to update database. so for that i have to get parameter to java class or implement method when user click url in mail.
? so I don't want get url parameters in jsp page. i want get update database when user click url in email. any suggestion



Thanks in Advance
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no way to connect to a DB from a link embedded in an email; it will have to go through server processing of some kind via HTTP. If you don't want JSP, fine - use a servlet (better anyway), or PHP, or ASP.Net, or whatever other server-side technology you prefer.
 
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic