Struts is the most reliable and most efficient framework to design the enterprise applications. The good way of reusing the code will improve the maintanance of the application.

Here is the sample structure of the Application:

formbeans: which stores the form data of the user

dto : The form we used for our business logic. It is recomonded to have no int etc. variables in form beans as it leads to conversion of user data which may fail if user enter wrong data. So we move this validation part to our dto's. All the fields of dto are clones of form beans except the return type.

mapper: these will map the form bean data to dto. We can use copyproperties() method of BeanUtils class to copy the data from form bean to dto.

actions: This package contains all the acction classes

dao: This package contains the Interfaces to invoke the backend data

dao-implementation: This package is the implementation of dao package.

service: This package is used to access the backend logic from our actions etc.

All jsp pages should go under some other directory either under root or WEB-INF.

Like it on Facebook, Tweet it or share this article on other bookmarking websites.

No comments