首页 > 其他分享 >SpringMVC配置文件位置

SpringMVC配置文件位置

时间:2023-03-22 10:34:10浏览次数:41  
标签:WEB 配置文件 SpringMVC APP 位置 color HOME red size


[size=large][color=red]在工程内:[/color][/size]

<context:property-placeholder location="classpath:/site.properties"/>



[size=large][color=red]在工程外:[/color][/size]


<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<!-- <property name="location"> <value>classpath:ecis.properties</value> </property> -->
<property name="locations">
<list>
<value>file:${PANDY_WEB_APP_HOME}/config/site.properties</value>
</list>
</property>
<property name="systemPropertiesMode">
<value>1</value>
</property>
<property name="searchSystemEnvironment">
<value>true</value>
</property>
<property name="ignoreUnresolvablePlaceholders">
<value>true</value>
</property>
</bean>


其中:${PANDY_WEB_APP_HOME}是VM Options里面配置的:


[color=darkblue]-DPANDY_WEB_APP_HOME="/mnt/D/pand_web_app_config"[/color]




[size=large][color=red]使用:[/color][/size]


<bean id="dataSource" class="${jdbc.dataSource}" destroy-method="close">
<property name="driverClassName" value="${jdbc.driver}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<!-- <property name="alias" value="${proxool.alias}" />
<property name="houseKeepingTestSql" value="${proxool.houseKeepingTestSql}" />
<property name="prototypeCount" value="${proxool.prototypeCount}" />
<property name="minimumConnectionCount" value="${proxool.minimumConnectionCount}" />
<property name="maximumActiveTime" value="3600000" /> -->
</bean>

标签:WEB,配置文件,SpringMVC,APP,位置,color,HOME,red,size
From: https://blog.51cto.com/u_3871599/6142198

相关文章