zoukankan      html  css  js  c++  java
  • web.xml——Error:cvc-complex-type.2.4.a: Invalid content was found starting with element

    配置web.xml文件时报错

    错误:cvc-complex-type.2.4.a: Invalid content was found starting with element

    详细报错信息:cvc-complex-type.2.4.a: Invalid content was found starting with element 'property'. One of '{"http://www.springframework.org/schema/beans":import, "http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean, WC[##other:"http://www.springframework.org/schema/beans"], "http://www.springframework.org/schema/beans":beans}'  is expected.

    原因:没找到元素property,该元素应该用bean元素包裹

    错误配置:

    <!-- 视图解析器 -->
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" />    
        <!-- 前缀 -->
        <property name="prefix">
            <value>/WEB-INF/content/</value>
        </property>
        <!-- 后缀 -->
        <property name="suffix">
           <value>.jsp</value>
        </property> 

    正确配置:

    <!-- 视图解析器 -->
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" >    
            <!-- 前缀 -->
            <property name="prefix">
                <value>/WEB-INF/content/</value>
            </property>
            <!-- 后缀 -->
            <property name="suffix">
               <value>.jsp</value>
            </property>
        </bean>
  • 相关阅读:
    iOS----------WKWebView修改userAgent
    Vmware路由配置
    【手机APP开发】指南
    【Git】git 指南
    【微信小程序开发】阮一峰老师的微信小程序开发入门教程——学起来~
    【vue】2-Keycode对照表
    【vue】1-vue简介与基础
    Meaning
    数据增强
    Dropout
  • 原文地址:https://www.cnblogs.com/it-mh/p/10552364.html
Copyright © 2011-2022 走看看