以SpringMVC为例
先引入命名空间
需要配置
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.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:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd"> </beans>
引入schema
Window->Preferences->XML->XML Catalog
点击添加add选择文件添加
在源码包里找到schema文件夹下的mvc schema
Key type选择Schema location
Key填写http://www.springframework.org/schema/mvc/spring-mvc.xsd
按代码提示就会有mvc标签提示了