Friday, August 24, 2007

web.xml specification header 2.3 or 2.4

This is a quick tip. There are two versions of the servlet specification in use now: 2.3 and 2.4.
The header for the web.xml file will be different in both cases.
In version 2.3 it is used a DTD do specify the XML format, and it is as follows:



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



In version 2.4 it is used a Schema to specify the XML Format. Here it is the format:


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

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

No comments: