加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – 匹配的通配符是严格的,但不能为元素找到声明

发布时间:2020-12-14 16:35:04 所属栏目:Java 来源:网络整理
导读:我正在使用 Springsource Tools Suite 3并试图实施拦截. 这是代码和错误被评论: 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/XMLSchem
我正在使用 Springsource Tools Suite 3并试图实施拦截.
这是代码和错误被评论:

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>

匹配的通配符是严格的,但是元素“道具”没有声明.

<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>

匹配的通配符是严格的,但是元素“道具”没有声明.

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

解决方法

<列表>和< ref>标签属于util namespace.先添加它:
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&gt ;.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读