• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Activate Account by clicking url in email

 
Ranch Hand
Posts: 85
Eclipse IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22696
129
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
It runs on an internal combustion engine. This ad does not:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic