Being somewhat lazy, I was very happy to find that I could create new servlet source code by going to New → Servlet, instead of going New → Class, and then editing the class in the servlet.
However, I found that every time I create a new servlet in Eclipse, Eclipse changes my web.xml.
In particular, it changes the top element to:
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" id="WebApp_ID" version="2.4">
(Linebreaks mine.)
This does not seem bad, but then it modifies the various subelements by putting "javaee:" in front of its name to indicate that these elements belong to this namespace.
For example, it changes
<display-name>ShowLifecycles</display-name>
to
<javaee:display-name>ShowLifecycles</javaee:display-name>
After which eclipse then complains about all the elements that it changed, and gave me such notation as:
cvc-complex-type.2.4.a: Invalid content was found starting with element 'javaee:display-name'. One of '{"http:// java.sun.com/xml/ns/j2ee":description, "http://java.sun.com/xml/ns/j2ee":display-name, "http://java.sun.com/xml/ns/ j2ee":icon, "http://java.sun.com/xml/ns/j2ee":distributable, "http://java.sun.com/xml/ns/j2ee":context-param, "http:// java.sun.com/xml/ns/j2ee":filter, "http://java.sun.com/xml/ns/j2ee":filter-mapping, "http://java.sun.com/xml/ns/ j2ee":listener, "http://java.sun.com/xml/ns/j2ee":servlet, "http://java.sun.com/xml/ns/j2ee":servlet-mapping, "http:// java.sun.com/xml/ns/j2ee":session-config, "http://java.sun.com/xml/ns/j2ee":mime-mapping, "http://java.sun.com/xml/ns/ j2ee":welcome-file-list, "http://java.sun.com/xml/ns/j2ee":error-page, "http://java.sun.com/xml/ns/j2ee":jsp-config, "http:// java.sun.com/xml/ns/j2ee":security-constraint, "http://java.sun.com/xml/ns/j2ee":login-config, "http://java.sun.com/xml/ns/ j2ee":security-role, "http://java.sun.com/xml/ns/j2ee":env-entry, "http://java.sun.com/xml/ns/j2ee":ejb-ref, "http:// java.sun.com/xml/ns/j2ee":ejb-local-ref, "http://java.sun.com/xml/ns/j2ee":service-ref, "http://java.sun.com/xml/ns/ j2ee":resource-ref, "http://java.sun.com/xml/ns/j2ee":resource-env-ref, "http://java.sun.com/xml/ns/j2ee":message- destination-ref, "http://java.sun.com/xml/ns/j2ee":message-destination, "http://java.sun.com/xml/ns/j2ee":locale- encoding-mapping-list}' is expected.
To make matters worse, when I use find and replace to remove everything so that the "javaee:" that places the file, Eclipse still complains about them, even if they are no more. I have to copy and paste the entire remaining file on top of myself so that these complaints disappear.
I am sure that Eclipse is trying to be useful, expecting some desire or need for this namespace. How can I do one of two things: