File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Multiple Login Attempts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Multiple Login Attempts" Watch "Multiple Login Attempts" New topic
Author

Multiple Login Attempts

vjy chin
Ranch Hand

Joined: Feb 17, 2005
Posts: 279
I am developing a web app using J2EE. I was struck in disabling the user account if he enters the information incorrectly 3 times. How can we proceed with this?

I am getting the user entered info and sending it to the action class, action class gives it to the services (delegate) class, which in turn pass to DAO class. I am not passing the request method to the DAO class, so I could not maintain a session. So how will I be able to do this.

Any ideas will be greatly appreciated. Also how do we create a new session in the DAO classes.

Thanks
Scott Johnson
Ranch Hand

Joined: Aug 24, 2005
Posts: 518
One way is to store a counter in the HttpSession object that records the number of failed login attempts.

I don't know what your delegate looks like, but you might have a method called something like validateUser() that returns a boolean. When that method returns false the Action class could update the counter in the Session.

Once it reaches 3, the Action class calls another method to disable the account.

Another way would be to store the counter in the database and let the delegate handle everything.
vjy chin
Ranch Hand

Joined: Feb 17, 2005
Posts: 279
Thanks Scott,

That was what I had thought and now implemented, i.e incrementing counter in action class.

But just wanted to know is there any way to get a session value in DAO class.

Thanks again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple Login Attempts