struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adam kramer <>
Subject Re: DB hit from ActionForm Validate method
Date Sat, 07 Sep 2002 21:22:39 GMT

It's not common practice to put business-data validation in the form beans
validate method, since this belongs in the data object (or
controller/service tier), so you should move that into the action class or
data object classes, and then you can use the database to update and
retrived login attempts in the same tier.

-adam k.

On Fri, 6 Sep 2002, Cohan, Sean wrote:

> We need to implement '3 strikes and your out' functionality to our logon
> process.  If the user is unsuccessful after 3 logon attempts, we disable
> their account.  I put some of the user id / password functionality in the
> validate method of the LogonForm class.  However, in between each attempt, I
> need find out what number of logon attempt they are on, and if this is not
> their 3rd attempt, bump up the logon attempt number. If it's their second
> attempt and they fail, I  need to let them know they only have 1 ore chance
> to get it right.  If they successfully logon, we also need to show them how
> many attempts it took them to logon the last time their account was
> accessed.
> We were thinking we'd store their current and previous logon attempt number
> in the DB.  My question is whether it is acceptable or common practice to
> access the DB from the validate method or should DB access only be done in
> the LogonAction class (which means I'd move the perform functionality to the
> LogonAction class)?
> Thanks.
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message