Brief Introduction to Spring (8) SSH integration and springssh Integration

Source: Internet
Author: User

Brief Introduction to Spring (8) SSH integration and springssh Integration
1. Integration of Spring and Struts2 1.1. Integration steps

1.2 configure web. xml

1.3 configure the spring configuration file applicationContext. xml

1.4 configure the struts configuration file

1.5. Action inherits the ActionSupport class

Ii. Integration of spring and hibernate 2.1 steps

2.2 inject sessionFactory

<-- Data source --> <bean id = "dataSource" class = "org. springframework. jdbc. datasource. driverManagerDataSource "> <-- or class =" org. apache. commons. dbcp. basicDataSource "--> <-- or class =" org. apache. commons. dbcp. basicDataSource "--> <-- driver --> <property name =" driverClassName "value =" oracle. jdbc. driver. oracleDriver "/> <-- url --> <property name =" url "value =" jdbc: oracle: thin: @ localhost: 1521: orcl "/> <-- User name --> <property name =" username "value =" accp "/> <-- password --> <property name =" password "vaule =" accp" /> </bean> <-- sessionFactory --> <bean id = "session" class = "org.springframework.org. hibernate3.LocalSessionFacotry "> <-- associate data source --> <property name =" dataSource "ref =" dataSource "/> <-- Some hibernate configurations-> <property name =" hibernateProperties "> <props> <prop key = "hibernate. dialect "> org. hibernate. dialect. oracle9Dialect </prop> </props> </property> <-- hibernate object class Configuration File> <property name = "mappingResources"> <list> <value> package name/Class name. hbm. xml </value> <value> package name/class name. hbm. xml </value> <list> </property> <bean>
Iii. SSH integration steps
/** 1. import struts2 jar package and struts2-spring-plugin-2.0.11.2.jar * 2. in the web. configure struts2 and spring information in xml respectively. the original Action in struts must inherit ActionSupport * 4. configure Action Bean * 5 in Spring. in the Struts2 configuration file, call the Bean * 6 configured in Spring. spring and Hibernate integration, you only need to configure SessionFactory 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.