1. Import Jar Package
2. Join Hibernate's support.
3. Join spring's support.
4. Build the System Package
5. Generate the Hibernate mapping file.
6. Writing DAO layer (interface-oriented programming)
(1) DAO Layer implementation class inheritance Hibernatedaosupport
(2) Inject sessionfactory into the Spring master configuration file
7. Writing the Biz layer (interface-oriented programming)
(1) Inject DAO in spring master configuration file
8. Join Struts Support
(1) Open the dynamic method call.
9. Write action inheritance Actionsupport class to inject biz into a spring environment
10. Preparation of Web.xml documents
' Configure Web.xml
<context-param>
<description>spring Main configuration file </description>
<param-name> Contextconfigloacation</param-name>
<param-value>classpath:applicationcontext.xml</ param-value>
</context-param>
Configure Spring Listener (load spring)
<listener>
< Listener-class>org.springframework.web.context.contextloaderlistener</listener-class>
</ Listener>
Configure Opensession
<filter>
<filter-name>opensession</filter-name>
<filter-class> Org.springframework.orm.hibernate3.support.opensessioninviewfilter</filter-class>
</filter>
<filter-mapping>
<filter-name>opensession</filter-name>
<url-pattern>/* </url-pattern>
</filter-mapping>
11 Configuration Struts.xml
<action name= "emp" class= "empaction" >
<result name= "Success" >/success.jsp</result>
</action> '
The class attribute value is the name of a bean in the spring configuration file