2011-03-04 16 views
8

he conseguido una mayor error en la web xmlWeb.xml error de validación

-Cannot resolver el nombre de 'JavaEE: Tipo de Aplicación web' a un componente (n) 'definición de tipo'.

y el archivo web.xml

<?xml version="1.0" encoding="UTF-8"?><!--error here--> 
<web-app 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_3_0.xsd" 

Respuesta

10

se le olvidó el espacio de nombres xmlns:web. Aquí está la declaración completa compatible con Servlet 3.0.

<?xml version="1.0" encoding="UTF-8"?> 
<web-app 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
    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_3_0.xsd" 
    id="Your_Webapp_ID" version="3.0"> 

    <!-- Config here --> 

</web-app> 
+0

¿No es XML-Standard para xmlns-Attributes utilizar URI en lugar de URL? Concreto: xmlns: web = "http://java.sun.com/xml/ns/javaee". Si no aparece ningún motivo aquí, editaré la respuesta en 4 semanas más o menos. – Tires

Cuestiones relacionadas