2014-11-03 56 views
0
"<mvc:annotation-driven enable-matrix-variables="true"/>  
    <context:component-scan base-package="Controllers" />" 

它給了我下面的錯誤信息:我想啓用矩陣變量,但它讓我看到消息

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 18 in XML document from ServletContext resource [/WEB-INF/appDispatcher-servlet.xml] is invalid; 
nested exception is org.xml.sax.SAXParseException; lineNumber: 18; columnNumber: 59; cvc-complex-type.3.2.2: Attribute 'enable-matrix-variables' is not allowed to appear in element 'mvc:annotation-driven'. 
+0

您使用的是什麼Spring Framework版本? – 2014-11-03 07:32:37

+0

@ Serge Ballesta'Spring 3.2.4' – 2014-11-03 07:35:54

+0

'請給答' – 2014-11-03 07:45:03

回答

1

我可以確認春3.2下正確的書寫是<mvc:annotation-driven enableMatrixVariables="true" >

這裏Spring Framework 3.2.4的工作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:util="http://www.springframework.org/schema/util" 
     xmlns:mvc="http://www.springframework.org/schema/mvc" 
     xmlns:c="http://www.springframework.org/schema/c" 
     xmlns:p="http://www.springframework.org/schema/p" 
     xmlns:context="http://www.springframework.org/schema/context" 
     xsi:schemaLocation=" 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd 
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd 
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd"> 

    <mvc:annotation-driven enableMatrixVariables="true" > 

請注意參考3.2 sc hemas

+0

謝謝你,它的工作原理 – 2014-11-03 11:39:08

相關問題