According to the
Accessing a Database documentation, a DataSource can be obtained in an Actions execute method.
Is this really where that type of logic should take place? I mean, if I need to validate a users authentication against a database, should it take place in the Action class? Because I have seen several examples where it is suggested that the Bean class handle that type of authentication. The problem with that is I have no access to the
servlet from the Bean class.
A simple example is Tom's
STRUTS 1.1 Tutorial from the newsletter. He shows authentication happening in the LoginBean class.
So what is the appropriate way to handle this? What is the point in the LoginBean or similar class if it is not to handle any validation?