S2SH development-integration 1

Source: Internet
Author: User

Integration steps:

1. Create a project

2. Change the coding of the entire project to UTF-8 format.

3. encode the entire jsp page into UTF-8 format.

4. Import the required jar package to the lib directory of the WEB-INF

-Struts

-Hibernate

-Spring

-Db

-Junit

5. Create three src folder

5.1 src stores source code

-Domain

-Dao

-Impl

-Service

-Impl

-Action

5.2 config stores all configuration files

-Struts2

-Hibernate

-Spring

-ApplicationContext. xml

ApplicationContext-db.xml

5.3 test store test cases

6. Write interfaces and classes in the corresponding packages of dao and service layers

7. Write sessionFactory in the applicationContext-db.xml File

8. Create a new class SessionFactoryTest in the test package to test whether SessionFactory is correctly configured.

9. Write spring declarative Transaction Processing

10. Write dao and service in the spring configuration file

11. Test declarative transaction processing using the savePerson Method

12. Write action

13. Compile the struts2 configuration file

14. Compile a web. xml file

14.1 web. xml configuration

Spring containers are integrated with tomcat in the form of listeners.

<Listener>

<Listener-class> org. springframework. web. context. ContextLoaderListener </listener-class>

</Listener>

<Context-param>

<Param-name> contextConfigLocation </param-name>

<Param-value> classpath: spring/applicationContext. xml </param-value>

</Context-param>

15. Test

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.