That is exactly what I mean.
Let's say you are doing a create user
- The form is posted with the user details (UserForm) and validated etc. The form may be something like a foo.bar.web.form.UserForm.
- The action would then call some business method on your service layer called say UserManager.createNewUser(User user).The User is the object that is mapped to the database and could well be something like foo.bar.model.User.
- If they are very similar you can make use of BeanUtils.copyProperties(userForm, user) from the common beanutils package. This will copy all the properties across that are the same name.
What you are trying to do here is offer some seperation between the web layer (E.g. the user interface) and the business services that you offer. Remember in many systems you have more than one access to your business layer - it may be that you offer SOAP services through the same UserManager object as well as a struts web application.
It's termed (here) a 3 tier architecture. Data Access (Where you do your Hibernate load, query etc), Business Logic (A nice interface to the hibernate logic with UserManager.createUser() type interfaces) and Presentation (Struts which will issue calls to the Business Layer).
I think you have the right idea though or else you wouldn't be querying WTF they are mapping struts forms to the DB...
P.s. If it is a really really simple application (and I mean really simple), then maybe mapping forms to the DB is acceptable, but not exactly good for maintainability, extensibility etc etc...
p.p.s. - my comment about generating the struts forms - you can use xdoclet tags in the mapped pojo and then generate a form from the pojo. This is not bad practice to as it saves you work - but normally I find you can do this once and then you change the form so can't do it any more.