JavaServerPages Standard Tag Library

Expression Language

If the web container is treating your expression language as JSTL 1.1, check the version of Servlet spec that you've specifed in the web-app entry of web.xml. It must be version 2.4 of the Servlet Specification for JSTL 1.1 to be interpreted correctly.

Confusingly the DTD seems to still be the 2.3 version for both 2.4 and 2.5.

XSD example for JSP 2.1 / Servlets 2.5 (Tomcat 6.0):

<?xml version="1.0" encoding="UTF-8"?>
<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/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      version="2.5">

</web-app>

XSD example for JSP 2.0 / Servlets 2.4 (Tomcat 5.5):

<?xml version="1.0" encoding="UTF-8"?>
<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">

</web-app>

DTD example for JSP 1.2 / Servlets 2.3 (Tomcat 5):

<?xml version="1.0" encoding="UTF-8"?> 
<!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>

See http://wiki.metawerx.net/wiki/Web.xmlDTDAndXSD

References


-- Frank Dean - 21 Aug 2007

Related Topics: DevelopmentSetup