Spring与Spring MVC配置文件加载失败,为何无法正确读取?
- 内容介绍
- 文章标签
- 相关推荐
本文共计481个文字,预计阅读时间需要2分钟。
Spring 和 Spring MVC 加载配置文件时,若在控制器中通过 @Value 注解读取不到配置值,解决方法是在 `applicationContext-m-servlet.xml` 中导入加载配置文件的 XML 文件(如 `applicationContext-s-configuration.xml`)。
解决方式是在applicationContext-m-servlet.xml 中导入加载配置文件的xml(applicationContext-s-configuration.xml)
applicationContext-m-servlet.xml
本文共计481个文字,预计阅读时间需要2分钟。
Spring 和 Spring MVC 加载配置文件时,若在控制器中通过 @Value 注解读取不到配置值,解决方法是在 `applicationContext-m-servlet.xml` 中导入加载配置文件的 XML 文件(如 `applicationContext-s-configuration.xml`)。
解决方式是在applicationContext-m-servlet.xml 中导入加载配置文件的xml(applicationContext-s-configuration.xml)
applicationContext-m-servlet.xml

