匹配的通配符是严格的,但是找不到元素的声明 [英] The matching wildcard is strict, but no declaration can be found for element

查看:176
本文介绍了匹配的通配符是严格的,但是找不到元素的声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Springsource Tools Suite 3并尝试实现拦截。
这是代码和错误被评论:

I'm using Springsource Tools Suite 3 and trying to implement interceptions. That's the code and errors are commented:

servlet-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定义解析期间出现意外故障:配置问题:找不到元素[list]的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>


推荐答案

< list> < ref> 标签属于 util namespace 。首先添加:

<list> and <ref> tags belong to util namespace. Add it first:

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"

然后恰当地为这些声明添加前缀:

And then prefix these declarations appropriately:

<util:list>
  ...

您也可以尝试使用< beans :util>

这篇关于匹配的通配符是严格的,但是找不到元素的声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆