<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<property name="ignoreResourceNotFound" value="true" />
<property name="locations">
<list>
<!-- 标准配置 -->
<value>classpath*:/application.properties</value>
</list>
</property>
</bean>
<!-- 数据源配置,使用应用内的DBCP数据库连接池 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<!-- Connection Info -->
<property name="driverClassName" value="${jdbc.driver}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<!-- Connection Pooling Info -->
<property name="initialSize" value="5" />
<property name="maxActive" value="100" />
<property name="maxIdle" value="30" />
<property name="maxWait" value="500" />
<property name="poolPreparedStatements" value="false" />
<property name="defaultAutoCommit" value="false" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
${hibernate.dialect}
</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/cfw/hibernate/Test.hbm.xml</value>
<value>org/cfw/hibernate/Dataofchina.hbm.xml</value>
</list>
</property>
</bean>
application.properties 内容如下
#mysql database setting
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost/ss?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=1234
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
#hibernate settings
hibernate.show_sql=false
hibernate.format_sql=false
hibernate.ehcache_config_file=/ehcache/ehcache-hibernate-local.xml
谁能帮我解释一下systemPropertiesModeName 和 ignoreResourceNotFound 这俩参数干嘛用的,第二个源程序里都没有这个变量...
分享到:
相关推荐
NULL 博文链接:https://chyy001.iteye.com/blog/1338488
主要介绍了Spring如何使用PropertyPlaceholderConfigurer读取文件,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
NULL 博文链接:https://wokeke.iteye.com/blog/2214113
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <value>classpath:/deploy.properties <!-- 配置sessionFactory ...
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <value>classpath:proxool.properties <bean id="dataSource" class="org.logicalcobwebs.proxool....
Spring中PropertyPlaceholderConfigurer的使用
Spring属性占位符PropertyPlaceholderConfigurer的使用,自己写的一个demo
spring3.1中文参考文档,南磊翻译,现在有4章,目录如下: 第一部分 Spring framework概述.......................................................................................................................
6 <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> 7 8 9 <value>/WEB-INF/jdbc.properties 10 11 12 13 14 它配置了以下功能: 读取...
23.3.Spring.Services.WindowsService.Process.exe应用程序 23.3.1.安装 23.3.2.配置 23.4.将应用程序上下文发布为Windows服务 23.4.1.service.config 23.4.1.1.让应用程序了解自身的位置 23.4.2.watcher.xml - 可选...
13.8. Spring对分段文件上传(multipart file upload)的支持 13.8.1. 介绍 13.8.2. 使用MultipartResolver 13.8.3. 在表单中处理分段文件上传 13.9. 使用Spring的表单标签库 13.9.1. 配置标签库 13.9.2. form标签 ...
3. New Features and Enhancements in Spring Framework 4.0 ............................................ 17 3.1. Improved Getting Started Experience .........................................................
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <value>classpath*:jdbc.properties <!-- 数据源配置,主要用于开发测试...
3. New Features and Enhancements in Spring Framework 4.0 ............................................ 17 3.1. Improved Getting Started Experience .........................................................
#Spring 属性注释扩展的 PropertyPlaceHolderConfigurer 使用注解将配置属性注入到 Spring 组件中。 注意:Spring 3 现在支持使用 @Value 注释的容器的。 该项目仅用于 Spring 2.5.x 支持。 ##入门Spring房产注解...
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <value>WEB-INF/jdbc.properties class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-...
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <value>classpath:jdbc.properties <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> ${...
PropertyPlaceholderConfigurer PropertyResourceConfigurer PropertyValue PropertyValues PropertyValuesEditor PrototypeAspectInstanceFactory PrototypeTargetSource ProxyConfig ProxyFactory ...
<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="/WEB-INF/red5-web.properties" /> <!-- ROOT web ...