spring通过.PropertyPlaceholderConfigurer读取配置文件
?<bean 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" 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"
??/>
??</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 这俩参数干嘛用的,第二个源程序里都没有这个变量...