spring web应用

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<bean id="propertyConfigurer" class="com.sf.integration.common.util.SSSPropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:server.properties</value>
<value>classpath:config.properties</value>
</list>
</property>
</bean>

<import resource="classpath:com/sf/remoting/server/META-INF/config/beans-server.xml" ></import>
<import resource="classpath:com/sf/remoting/server/META-INF/config/beans-database.xml" />
<import resource="classpath:com/sf/integration/common/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/ocrAddress/META-INF/config/beans.xml"/>
</beans>

 

ApplicationContext ctx = new ClassPathXmlApplicationContext("int-kafka-context.xml");
//初始化SpringContextUtil
SpringContextUtil.init(ctx);

 

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/beans.xml</param-value>
</context-param>

<context-param>
<param-name>webAppRootKey</param-name>
<param-value>webApp.root</param-value>
</context-param>

<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.xml</param-value>
</context-param>
<listener>
<listener-class>
com.sf.integration.common.listener.SSSLog4jConfigListener
</listener-class>
</listener>

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

<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>


<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<resource-ref>
<res-ref-name>sss_new-ds</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

</web-app>

 

beans.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-3.0.xsd">

<bean id="propertyConfigurer" class="com.sf.integration.common.util.SSSPropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>file:${CONF_PATH}/*.properties</value>
</list>
</property>
</bean>

<!--jndi配置方式-->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="sss_new-ds" />
<property name="resourceRef" value="true" />
</bean>

<!--<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="oracle.jdbc.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@10.202.46.36:1521:ssssit"/>
<property name="username" value="sssks"></property>
<property name="password" value="sssks"></property>
<property name="maxActive" value="5"></property>
<property name="maxIdle" value="2"></property>
<property name="maxWait" value="10"></property>
</bean>-->

<bean id="sessionFactoryAutowiring" class="com.sf.framework.server.core.deploy.SessionFactoryAutowiring">
<property name="sessionFactory" ref="sessionFactory" />
</bean>

<bean id="defaultLobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true"/>

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />

<property name="mappingResources">
<list>
<value>com/sf/integration/common/META-INF/config/mapping.xml</value>
<value>com/sf/integration/schtblcustaddr/META-INF/config/mapping.xml</value>
<value>com/sf/integration/billhasreached/META-INF/config/mapping.xml</value>
<value>com/sf/integration/hht/META-INF/config/mapping.xml</value>
<value>com/sf/integration/rms/META-INF/config/mapping.xml</value>
<value>com/sf/integration/bill/META-INF/config/mapping.xml</value>
<value>com/sf/integration/uploadidentrs/META-INF/config/mapping.xml</value>
<value>com/sf/integration/uploadEasyinput/META-INF/config/mapping.xml</value>
<value>com/sf/integration/uploadaddridentlog/META-INF/config/mapping.xml</value>
<value>com/sf/integration/perauilog/META-INF/config/mapping.xml</value>
<value>com/sf/integration/abroadident/META-INF/config/mapping.xml</value>
<value>com/sf/integration/expimage/META-INF/config/mapping.xml</value>
<value>com/sf/integration/addrinputrs/META-INF/config/mapping.xml</value>
<value>com/sf/integration/bag/META-INF/config/mapping.xml</value>
<value>com/sf/integration/unload/META-INF/config/mapping.xml</value>
<value>com/sf/integration/waybillpicup/META-INF/config/mapping.xml</value>
<value>com/sf/integration/waitaddrckinbuff/META-INF/config/mapping.xml</value>
<value>com/sf/integration/upTtWaitArtifidentUpLog/META-INF/config/mapping.xml</value>
<value>com/sf/integration/uploadtelsnap/META-INF/config/mapping.xml</value>
<value>com/sf/integration/uploadsortfaillog/META-INF/config/mapping.xml</value>
<value>com/sf/integration/uploadDeptDel/META-INF/config/mapping.xml</value>
<value>com/sf/integration/updateNewIdentLog/META-INF/config/mapping.xml</value>
<value>com/sf/integration/sysauilog/META-INF/config/mapping.xml</value>
<value>com/sf/integration/addrInfo/META-INF/config/mapping.xml</value>
<value>com/sf/integration/telhissrc/META-INF/config/mapping.xml</value>
<!--<value>com/sf/integration/config/META-INF/config/mapping.xml</value>-->
<value>com/sf/integration/uploadProblemWaybillRs/META-INF/config/mapping.xml</value>
<value>com/sf/integration/ocrAddress/META-INF/config/mapping.xml</value>
</list>
</property>

<!--
<property name="mappingLocations">
<list>
<value>classpath:/com/sf/integration/*/META-INF/config/mapping.xml</value>
</list>
</property>
-->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.jdbc.batch_size">50</prop>
</props>
</property>
<property name="lobHandler" ref="defaultLobHandler" />
</bean>
<!--
<import resource="classpath:com/sf/integration/*/META-INF/config/beans.xml"/>
-->
<import resource="classpath:com/sf/integration/common/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/billhasreached/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/schtblcustaddr/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/hht/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/rms/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/bill/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/uploadidentrs/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/uploadEasyinput/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/uploadaddridentlog/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/perauilog/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/abroadident/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/expimage/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/addrinputrs/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/bag/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/unload/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/waybillpicup/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/waitaddrckinbuff/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/upTtWaitArtifidentUpLog/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/uploadtelsnap/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/uploadsortfaillog/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/uploadDeptDel/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/updateNewIdentLog/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/sysauilog/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/addrInfo/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/telhissrc/META-INF/config/beans.xml"/>
<!--<import resource="classpath:com/sf/integration/config/META-INF/config/beans.xml"/>-->
<import resource="classpath:com/sf/integration/uploadProblemWaybillRs/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/ocrAddress/META-INF/config/beans.xml"/>
</beans>

posted @ 2017-07-13 21:27  adaandy  阅读(138)  评论(0编辑  收藏  举报