• Post Reply Bookmark Topic Watch Topic
  • New Topic

web.xml behaviour for Tomcat 6  RSS feed

 
yogesh kalaskar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using following web.xml my application

<?xml version="1.0" encoding="ISO-8859-1"?>

<!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>

</web-app>

But after checking the tomcat site they have given sample application for tomcat 6 according to java servlet 2.4 spec & jsp 2.0 spec. It does not have DOCTYPE but instead it has <web-app> like

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">


see web.xml
-----------------------------------------

Is there any difference between these 2 decleration. Its really confusing the mind. Please guide.

Thanks in Advance,
Yogesh g k
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first is for Servlet Spec 2.3.
If you use this, many of the features of more recent versions of the servlet and JSP specs won't work (JSTL, EL, etc...)
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More to the point of your original question,
More recent versions have moved from DTD validation to XML Schemas.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!