簡體   English   中英

Spring MVC 3.1 - 命名空間錯誤

[英]Spring MVC 3.1 - Namespace error

我在dispatcher-servlet.xml有以下內容

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:util="http://www.springframework.org/schema/util"
       xmlns:beans="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="http://www.springframework.org/schema/mvc
                           http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
                           http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                           http://www.springframework.org/schema/context
                           http://www.springframework.org/schema/context/spring-context-3.1.xsd
                           http://www.springframework.org/schema/util
                           http://www.springframework.org/schema/util/spring-util-3.1.xsd">

XML驗證失敗了

從元素'context:component-scan'開始發現無效內容。 其中一個'{“http://www.springframework.org/schema/mvc":argument-resolvers,,http://www.springframework.org/ schema / mvc”:return-value-handlers}'是預期的。

我檢查了http://www.springframework.org/schema/mvc/定義的模式,一切似乎都沒問題。 以前我使用的是Spring mvc 3.0,它沒有遇到任何問題。 我將所有jar文件直接放在WEB-INF/lib 有任何想法嗎?

更新

這是驗證失敗的行<context:component-scan base-package="com" />是的,所有使用的jar都來自Spring 3.1

可能是錯的,但是查看模式和給出的錯誤,您是否可能嘗試在<mvc:annotation-driven> </mvc:annotation-driven>放置<context:component-scan base-package="com" /> -element <mvc:annotation-driven> </mvc:annotation-driven> -tags或忘記關閉<mvc:annotation-driven> -tag? 將組件掃描放在標簽外部或正確關閉<mvc:annotation-driven> -tag。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM