Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Requird password generator code

 
Priyanka Dande
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to java, i need to take email id of the user and generate the password accordingly and send the Emailid and password by mail to the user, i have written the code as well, kindly help i am not able to write the correct
code

the above code is the servlet code and i have also written html form for the same


urgent help required please




 
Ganesh Patekar
Bartender
Pie
Posts: 561
22
Eclipse IDE Hibernate Java jQuery MySQL Database Netbeans IDE Oracle Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please go through --> Ease Up
 
Dave Tolls
Ranch Hand
Posts: 1904
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the issue you are having with your code?
Does it compile?
If it runs then what happens and what should happen?

I will note that you should be using a PreparedStatement rather than concatenating your INSERT statement together.
 
M Khalid
Ranch Hand
Posts: 45
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it compile?
You have two classes with same name "StringUtils" ?

IMO, you should create a class in which you can have password creation function , db connect function and your servlet should just pass email id/username.
and call the functions to perform actions.
 
Stephan van Hulst
Bartender
Posts: 6323
78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this an exercise? If not and this is real world code, then DON'T DO THIS.

First of all, you should never store passwords in your application in plain text. Use a key derivation algorithm like bcrypt or PBKDF2.

Secondly, NEVER e-mail passwords. If user accounts are created without interaction of the user, they should provide a password on their first login.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic