11

私は Springsource Tools Suite 3 を使用しており、傍受を実装しようとしています。それがコードで、エラーはコメントされています:

サーブレット-context.xml

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

<annotation-driven />

<resources mapping="/resources/**" location="/resources/" />

<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <beans:property name="prefix" value="/WEB-INF/views/" />
    <beans:property name="suffix" value=".jsp" />
</beans:bean>

<beans:bean id="authInterceptor" class="com.bank.accounting.authentication.AuthInterceptor" />
<beans:bean id="authUrlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">

Bean 定義の解析中に予期しないエラーが発生しました: 構成の問題: 要素 [リスト] の BeanDefinitionParser が見つかりません

    <beans:property name="interceptors">
        <list>

一致するワイルドカードは厳密ですが、要素 'list' の宣言が見つかりません。

            <ref bean="authInterceptor" />
        </list>
    </beans:property>
    <beans:property name="mappings">
        <props>

一致するワイルドカードは厳密ですが、要素 'props' の宣言が見つかりません。

            <prop key="/home">HomeController</prop>
        </props>
    </beans:property>
</beans:bean>
<beans:bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">

Bean 定義の解析中に予期しないエラーが発生しました: 構成の問題: 要素 [props] の BeanDefinitionParser が見つかりません

    <beans:property name="mappings">
        <props>

一致するワイルドカードは厳密ですが、要素 'props' の宣言が見つかりません。

            <prop key="/login">LoginController</prop>
        </props>
    </beans:property>
</beans:bean>
</beans:beans>
4

1 に答える 1

44

<list>タグはnamespace<ref>属します。最初に追加します。util

xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"

そして、これらの宣言に適切なプレフィックスを付けます。

<util:list>
  ...

で試すこともできます<beans:util>

于 2012-09-01T09:26:08.007 に答える