Now give the US old work project, they need to be implemented with "Struts Spring Hibernate", which is the solution to them:
1, let me talk about the layer
In fact, there is no need to use Struts unless you have a historical legacy problem to use Struts, because Spring's MVC is already good enough:
a. Clear model object passes, this model object can be any Java object, if you don't care about passing the same object between the layers
If this model object can be Hibernate's persistent Object, through Open Session in View, you can use industry in a consistent way
Time object.
b. Reference Data, let you clear the Look Up data.
c. A variety of available view resolution types, can define the logical name of the Page in the prperties file, or define the Struts in the XML file.
TILES logical name.
d. Data binding without interference, one
Spring binding features do not interfere with the interface layout, that is, you can still use the HTML editor to process the page.
e. Client verification.
f. server side verification.
g. A variety of optional controllers, where the controller that supports the form provides a function of similar VB's formal event processing, this is a series of
Workflow, insert your processing code in the place you think is appropriate.
Spring MVC is compared to Struts, it may just have a lot of Taglib and page layouts, but this can be added through third-party tools, because the view is more lightweight than other parts. The third-party tool that can be selected can be: DisplayTag, Struts-Menu, Struts Tiles, and more.
2, talk about business logic
Business Logic class can be configured with Spring Beans and manage the relationship between the controller of the performance layer and the lower-level DAO object by Spring. In addition, you can perform configurable transaction, an interceptor configuration, eliminating all your worries.
3, DAO layer
The Hibernate API encapsulated with Spring, let Hibernate continue to slim, and establish the relationship with the upper layer via Spring.
4, finally, Hibernate's PO You can choose any way you like, the following tools provide enough support:
a. From the Java object to HBM file: xdoclet
b. From HBM files to Java objects: Hibernate Extension
c. From the database to HBM file: MiddleGen
d. From HBM files to the database: SchemaExport
As for the reference, you can check out the example of Spring PetClinic (Spring Hibernate), there is a non-viewable website: http://raibledesigns.com/wiki/wiki.jsp? Page = Appfuse (Struts Spring Hibernate or Spring MVC Spring Hibernate). In addition, Spring's MVC Step-by-Step is a good start-up tutorial.