Java - error en el web.xml

 
Vista:

error en el web.xml

Publicado por Marcos (44 intervenciones) el 29/12/2008 14:00:12
Hola buenas

tengo un error en el web.xml pero no afecta a la hora de ejecutar la aplicacion. Ospongo el codigo para que veais.

<!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>
<display-name>spring1</display-name>

<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.xml</param-value>
</context-param>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext*.xml</param-value>
</context-param>

<servlet>
<servlet-name>spring1</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>spring1</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<!-- Spring -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>

<jsp-config>
<taglib>
<taglib-uri>/spring</taglib-uri>
<taglib-location>/WEB-INF/tld/spring-form.tld</taglib-location>
</taglib>
</jsp-config>

<welcome-file-list><welcome-file>index.jsp</welcome-file></welcome-file-list>

</web-app>

en en la definicion de web-app a la hora de abrirlo, se marca con la linea roja tipica de errores

y dice lo sigiente:

the content of element type"web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*, taglib*,login-config? etc)"

Gracias de antemano

Un saludo
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:error en el web.xml

Publicado por mario (622 intervenciones) el 29/12/2008 15:58:08
El problema esque estas usando sintaxis de la especificacion j2ee 1.4 y estas trabajando con 1.3 en especial estas lineas

<jsp-config>
<taglib>
<taglib-uri>/spring</taglib-uri>
<taglib-location>/WEB-INF/tld/spring-form.tld</taglib-location>
</taglib>
</jsp-config>


tu web.xml deberia quedar asi:


<!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>
<display-name>spring1</display-name>

<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.xml</param-value>
</context-param>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext*.xml</param-value>
</context-param>

<!-- Spring -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>

<servlet>
<servlet-name>spring1</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>spring1</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<taglib>
<taglib-uri>/spring</taglib-uri>
<taglib-location>/WEB-INF/tld/spring-form.tld</taglib-location>
</taglib>

<welcome-file-list><welcome-file>index.jsp</welcome-file></welcome-file-list>

</web-app>

espero te sirva la informacion
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar