使用@value注解给属性注入的时候一直报错Could not resolve placeholder 'customer.from.type' in string value "${customer.from.type}"
在网上找到答案大部分都是说
<context:property-placeholder location="" />在多个spring配置文件中这个标签只能写一个,经检查并非这个错误。
查看web.xml文件
未被注释的是原来的写法,我将spring文件夹下的所有配置文件都加入到了web容器中,再看spring文件夹
在这个文件夹中是包含过springmvc的配置文件的,而在配置dispatcherservlet的配置文件的时候
又配置了一遍springmvc,导致了这个错误
最后解决办法:
在这里去掉springmvc的配置文件。