【问题标题】:cvc-complex-type.2.2: Element 'location' must have no element [children]cvc-complex-type.2.2:元素“位置”必须没有元素 [children]
【发布时间】:2014-03-10 06:21:31
【问题描述】:

我在 error-page 标签上的 web.xml 文件中遇到此错误:

cvc-complex-type.2.2:元素“位置”必须没有元素 [孩子们],

我的 web.xml 文件如下所示(未显示其他标签):

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd" version="3.0">

<error-page>
    <error-code>404</error-code>
    <location>/pages/error/404.jsp</location>
</error-page>
 </web-app>

【问题讨论】:

    标签: java web.xml custom-error-pages


    【解决方案1】:

    修复:

    Servlet 3.0 不支持这些错误页面标记:

    在 web.xml 的标头中将 Servlet 版本更改为:version="2.5",并将 schemaLocation 更改为 web-app_2_5.xsd

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-20
      • 1970-01-01
      • 1970-01-01
      • 2014-12-28
      • 2018-12-23
      • 1970-01-01
      • 2012-10-25
      • 2014-11-27
      相关资源
      最近更新 更多