更新时间:2023-11-17 19:52:52
您的问题是您已将web.xml标记为符合servlet 2.3
Your problem is that you have marked your web.xml as being servlet 2.3 compliant (or perhaps not even that - I am not sure how your doctype in a comment is interpreted)
<?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">
您需要至少符合servlet 2.5才能使Eclipse工具正常工作。
and you need it to be at least servlet 2.5 compliant for the Eclipse tooling to work.
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
(未测试 - 从 http://javahowto.blogspot.dk/2009/10/sample-webxml-servlet-25.html )
您可能需要重新创建Eclipse项目以便更新。
You may need to recreate the Eclipse project to have the changes picked up.