tx:annotation-driven' 的前缀 'tx' 未绑定。

tx:annotation-driven' 的前缀 'tx' 未绑定。

解决方案:

在架构spring为基础的web项目的时候有人会遇见这样的一些错误:

前缀 'aop' 未绑定,前缀 'tx' 未绑定,前缀 'mvc' 未绑定等,

解决这些问题的关键就是需要在对应的XML配置文件开头引入下面着色部分的内容:

 

<?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"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
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://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">

 

eclipse代码效果:

tx:annotation-driven' 的前缀 'tx' 未绑定。