Spring_元素 "context:annotation-config" 的前缀 "context" 未绑定
2016-03-24 22:12
666 查看
<?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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" <u>xmlns:context="http://www.springframework.org/schema/context"</u> xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd <u>http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd </u> http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <!-- <bean id="animal" class="ioc.Animal"> <property name="animalType"> <value>Dog</value> </property> <property name="moveMode"> <value>fly</value> </property> </bean> --> <context:annotation-config/> <bean id="movePrinter" class="ioc.ScreenPrinter"></bean> <bean id="animal" class="ioc.Animal"> <!-- <property name="printer" ref="movePrinter"></property> --> <!-- 1、自动装配 --> <!-- 2、使用注解来自动装配 --> <property name="animalType"> <value>Dog</value> </property> <property name="moveMode"> <value>fly</value> </property> </bean> <!-- <bean id="animal" class="ioc.Animal"> <constructor-arg index="0" type="java.lang.String" value="Bird"></constructor-arg> <constructor-arg index="1" type="java.lang.String" value="fly"></constructor-arg> </bean> --> </beans>
下划线标注的行很重要,解决问题的关键!
相关文章推荐
- 一个jar包里的网站
- 一个jar包里的网站之文件上传
- 一个jar包里的网站之返回对媒体类型
- Spring整合Quartz(JobDetailBean方式)
- Spring整合Quartz(JobDetailBean方式)
- 模拟Spring的简单实现
- spring+html5实现安全传输随机数字密码键盘
- Spring中属性注入详解
- SpringMVC框架下JQuery传递并解析Json格式的数据是如何实现的
- struts2 spring整合fieldError问题
- spring的jdbctemplate的crud的基类dao
- 读取spring配置文件的方法(spring读取资源文件)
- Spring Bean基本管理实例详解
- java实现简单美女拼图游戏
- 详解Java的Spring框架中的事务管理方式
- 解析Java的Spring框架的BeanPostProcessor发布处理器
- Java开发框架spring实现自定义缓存标签
- java基本教程之线程休眠 java多线程教程
- JSP开发中在spring mvc项目中实现登录账号单浏览器登录
- JavaEE通过response实现请求重定向