SSH Integrated Environment build (XML)

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.