SSH简单整合
/*首先是配置Spring的applicationContext.xml文件*/ <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="dataSource" destroy-method="close"> <property name="driverClass" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"></property> <property name="jdbcUrl" value="jdbc:microsoft:sqlserver://127.0.0.1:1433;databasename=pubs"></property> <property name="user" value="sa"></property> <property name="password" value=""></property> <property name="maxPoolSize" value="20"></property> <property name="minPoolSize" value="20"></property> <property name="initialPoolSize" value="1"></property> <property name="maxIdleTime" value="20"></property> </bean> <bean id="sessionFactory" value="/WEB-INF/classes/applicationContext.xml"/> </plug-in> 2.在web.xml文件中通过监听器的形式来读取 <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/classes/applicationContext.xml </param-value> </context-param>
?
?