SSH Integration Summary A

Source: Internet
Author: User

Configuration in 1.web.xml
STRUTS2 Filter <filter><filter-name>struts2</filter-name><filter-class> org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter</filter-class></filter>< filter-mapping><filter-name>struts2</filter-name><url-pattern>/*</url-pattern>< Filter-mapping> Add Spring Context configuration <context-param><param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value><context-param> Add Listener <listener ><listener-class>org.springframework.web.context.contextloaderlistener</listerner-class></ Listener>

Configuration in 2.applicationcontext.xml
The data source configuration in the 
 applicationcontext.xml can be replaced with a different data source <bean id= "DataSource" class= " Org.apache.commons.dbcp.BasicDataSource "> Property-driven <property name=" Driverclassname "value=" Oracle.jdbc.driver.OracleDriver "/> Connection url<property name=" url "value=" Jdbc:oracle:thin: @localhost: 1521:ORCL "/ > User name <property name= "username" value= "ACCP"/> password <property name= "password" value= "ACCP"/></bean> Configure Sessionfactory<bean id= "Sessionfactory" class= "Org.springframework.orm.hibernate3.LocalSessionFactoryBean" > Associated data source <property name= "DataSource" ref= "DataSource"/> Configure hibernate properties <property name= "Hibernateproperties "><props> the dialect that connects the database depends on different data and version <prop key=" Hibernate.dialect "> org.hibernate.dialect.oracle9dialect</prop></props></property> mapping File configuration <property name= " Mappingresources "><list><value> implements the Hibernate configuration file path/class name for the class. hbm.cfg</value><value></ Value></list></property></bean> 

Configuration in 3.struts.xml

After configuring Struts's action in Applicationcontext.xml
The class of action in Struts.xml to write the ID of the action that configures struts in Applicationcontext.xml

SSH Integration Summary A

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.