• 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>

  • 相关阅读:
    安装mysql时 Write configuration file 错误
    Statement和PreparedStatement之间的区别
    Matlab 的fspecial函数用法
    MySql 5.1 在线中文参考手册
    Rational License Key Error 的解决办法
    Admin5论坛营销插件
    actcms发布模块,如何使用?
    博客大巴(BlogBus)
    淘宝评论采集,因为是原创
    忍者X3又添新成员 IIS6批量建站
  • 原文地址:https://www.cnblogs.com/heyanan/p/7163225.html
Copyright © 2020-2023  润新知