当前位置:   article > 正文

web.xml——Error: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 'bas

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

 

转载于:https://www.cnblogs.com/it-mh/p/10552364.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/265436
推荐阅读
相关标签
  

闽ICP备14008679号