Form Bean as far as I know is just to store your information to be passed from Action to JSP and to store request parameters. Generally a DAO class is used to get data from the database. And the Action should use that database as all the business logic is supposed to be in the action...
Yes your are RIGHT that DAO should be used to get the data from DB.
But CAN WE USE DAO INSTANCES IN BEAN CLASS? IS it LEGAL?
Lets say, if I have a condition in which I want to populate some properties on page load then can I use DAO in Beans?
As far as BIZ LOGIC is concerned, I think its best practice to put your biz logic in Business Delegate rather than in Action because Action's primarily use s to handle request, response, session, forwarding and other such operations.
Yes sorry, action is not supposed to contain the business logic. As far as using DAO in the form bean is concerned, its definitely legal. I would still not recommend using DAO in form beans. I'm actually more familiar with struts 2, and there's no form bean in it (there's model driven concept but its a bit different). You said that you want to populate some properties on page load, I cannot understand what you meant by that. If there is a particular use case where you feel that using DAO in the form bean is the best solution, then you can use it...
subject: Is it LEGAL to access DB from Bean(FormBean of struts)