SpringMVC通过@Value Controller 和 service注解读取.properties配置

1.在 spring-mybatis.xml中配置  service里面就可以读取到了

<!-- 引入配置文件  -->
    <context:property-placeholder location="classpath:*.properties" ignore-unresolvable="true"/> 

 2.同上,在spring-mvc.xml中配置 controller就可以读取到了

<!-- 引入配置文件  -->
    <context:property-placeholder location="classpath:*.properties" ignore-unresolvable="true"/>

猜你喜欢

转载自blog.csdn.net/qq_15700115/article/details/85837126