eclipse编写spring等xml配置文件时只有部分提示,tx无提示

eclipse编写spring等xml配置文件时只有<bean>、<context>等有提示,其他标签都没有提示

这时就需要做以下两步操作(下面以事务管理标签为例)

1,添加命名空间“xmlns:tx”

 xmlns:tx="http://www.springframework.org/schema/tx"

2,在“xsi:schemaLocation”里新增xsd文件路径

http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd

下面是一个完整的示例

<?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:tx="http://www.springframework.org/schema/tx"
 xsi:schemaLocation="
 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
  http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">

 

posted @ 2016-11-01 15:02  行-云  阅读(3730)  评论(0编辑  收藏  举报