• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Requird password generator code

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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




 
Bartender
Posts: 1251
87
Hibernate jQuery Spring MySQL Database Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please go through --> Ease Up
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 100
2
Python Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 15491
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic