使用mvc標籤顯示不能識別
<mvc:annotation-driven conversion-service="ConversionService"/>
報錯:
he matching wildcard is strict,but not declaration can be found for element 'mvc:annotation-driven’
問題是不能識別"mvc:annotation-driven/"這個標籤,肯定是xml約束檔案引入的問題。修改引入的xml約束,新增約束:
xmlns:mvc="http://www.springframework.org/schema/mvc"
<?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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">