gpt4 book ai didi

java - 将 web.xml 从 2.3 升级到 2.4 时出现问题

转载 作者:行者123 更新时间:2023-11-29 07:21:14 26 4
gpt4 key购买 nike

我正在尝试将我的 web.xml 从 2.3 升级到 2.4,所以我将我的 web.xml 更改为类似这样的东西 -

<?xml version="1.0" encoding="UTF-8"?>
<!--<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1
Servlet 2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">-->

<!--
===========================================================
WUI - WEB.XML
===========================================================
-->

<web-app id="WebApp" xmlns="http://java.sun.com/xml/ns/j2ee"
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_2_4.xsd"
version="2.4">

<description>Odyssey Web User Interface</description>
<display-name>wui</display-name>



<!-- Uncomment this when setting up the prevent-multiple-login mechanism -->
<!--
<listener>
<listener-class>com.xxx.xxxnListener</listener-class>
</listener>
-->

<!-- local cache filter setup -->
<filter>
<filter-name>local-cache</filter-name>
<filter-class>com.xxx.xxxcheFilter</filter-class>
</filter>
....

当我启动服务器时,出现此错误 -

weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND problem: cvc-complex-type.2.4a: Expected elements 'servlet-class@http://java.sun.com/xml/ns/javaee jsp-file@http://java.sun.com/xml/ns/javaee' instead of 'display-name@http://java.sun.com/xml/ns/javaee' here in element servlet@http://java.sun.com/xml/ns/javaee: problem: cvc-complex-type.2.4a: Expected elements 'servlet-class@http://java.sun.com/xml/ns/javaee jsp-file@http://java.sun.com/xml/ns/javaee' instead of 'description@http://java.sun.com/xml/ns/javaee' here in element servlet@http://java.sun.com/xml/ns/javaee:

我正在使用 weblogic 10.1 服务器。

知道我还应该做什么。

谢谢。

最佳答案

你的 web.xml 的结构需要更改以通过新的 XSD。例如,新的 XSD 声明您的 web.xml 文件应包含:

<servlet-class><jsp-file>作为您当前所在位置的元素 <display-name>

http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd 阅读 XSD有关更多详细信息,重组应该不会花费很长时间才能通过。

关于java - 将 web.xml 从 2.3 升级到 2.4 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4156919/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com