今天在整合Spring和其他框架的时候在配置文件中添加<context:annotation-config />时一直有红色的波浪线在这个代码的下面,后来发现应该xml的头部没有申明context前缀。
所以使用下面的spring文件就可以
Spring 3.X如下:
Spring 2.x则将后缀
"...-3.x.xsd"
改为
"...-2.x.xsd"
所以使用下面的spring文件就可以
Spring 3.X如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
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">
Spring 2.x则将后缀
"...-3.x.xsd"
改为
"...-2.x.xsd"