Cannot get property value using @Value in spring mvc Controller

http://www.cnblogs.com/xianan87/p/3942010.html

http://blog.csdn.net/cqnaqjy/article/details/51836465



SAXParseException: cvc-elt.1: The element "beans" could not be found statement
quote
A web project passed the local test, and maven put a war package under weblogic to report an error,

SAXParseException: cvc-elt.1: The declaration of the element "beans" could not be found.
Baidu didn't quite understand it. Then I checked my applicationContext.xml and found that The version of spring is wrong,

http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org /schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd

In fact, my spring package is 3.0, just change this paragraph,

http://www.springframework .org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/ schema/context/spring-context-3.0.xsd

http://blog.csdn.net/xiaxiaorui2003/article/details/51850121

We can get the value injected by @Value in our service, because we usually define the acquired attribute file in applicationContext.xml, so that in It is not available in the Controller, you must define the acquisition property file in dispatcher-servlet.xml
http://blog.sina.com.cn/s/blog_c1bea6fb0102wa0x.html

SpringMVC 4.2.2 - Web.xml,Dispatcher -Servlet and ApplicationContext configuration notes
http://blog.csdn.net/chendev1/article/details/50294381

The difference between applicationContext.xml and dispatcher-servlet.xmlhttps
://www.cnblogs.com/parryyang/p/5783399 . html

Spring's @Value can't get the value
https://www.cnblogs.com/GregZQ/p/8365277.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326376215&siteId=291194637