File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to detect first time login to the web application

 
deepika mane
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have developed a web application using struts 2 framework . I want to generate a password automatically on first time log in to the application and send a notification mail with new password and a link to change that password. How to detect the first time log in of the user?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Store a flag with the user. Or have a last login date field that isn't filled until they've logged in. Or check for a cookie (only works if cookies are enabled).

In any case, this has nothing to do with JSP; I'll move to... um... Struts, since you're using Struts, although there's nothing Struts-specific, either.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can check if there is a session. You can check if it's new and if returns true, you got you first time visitor.

http://download-llnw.oracle.com/javaee/1.2.1/api/javax/servlet/http/HttpSession.html#isNew%28%29

Be aware that cookies should be enabled.
 
deepika mane
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hiii,

Thanks for your reply
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic