properties.properties
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/kgcnews?useUnicode=true&characterEncoding=UTF-8
user=root
password=root
<!--引入配置文件,主要用这种-->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:zscbbs.properties</value>
</property>
</bean>
<!--引入配置文件,和上面一样效果,但在WEB.xml配置 启动服务时加载配置文件时会出错-->
<context:property-placeholder location="properties.properties"/>
properties.properties配置文件
最新推荐文章于 2024-07-02 11:38:21 发布