gpt4 book ai didi

java - 元素类型 "servlet"的内容必须匹配“(icon?,servlet-name,display-name?,

转载 作者:太空宇宙 更新时间:2023-11-04 14:31:54 25 4
gpt4 key购买 nike

我知道是关于顺序的,但我已经尝试了所有的可能性,有人可以解释一下我的 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">

<web-app>
<listener>
<listener-class>com.ewheelz.SessionCounter</listener-class>
</listener>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>ConnectionPool</servlet-name>
<servlet-class>com.ewheelz.ConnectionPool</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>ConnectionPool</servlet-name>
<url-pattern>/servlet/ConnectionPool</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>Home.html</welcome-file>
</welcome-file-list>

</web-app>

最佳答案

更改此

<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>ConnectionPool</servlet-name>
<servlet-class>com.ewheelz.ConnectionPool</servlet-class>
</servlet>

对此:-

  <servlet>    
<servlet-name>ConnectionPool</servlet-name>
<display-name>This is the display name of my J2EE component</display-name>
<description>This is the description of my J2EE component</description>
<servlet-class>com.ewheelz.ConnectionPool</servlet-class>
</servlet>

diplay-name 和描述标记应位于 servlet-name 标记之后

关于java - 元素类型 "servlet"的内容必须匹配“(icon?,servlet-name,display-name?,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26046374/

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