Monday
14Dec2009
Maven Users: Update Your web.xml files to 2.4 to use JSTL Tags
Monday, December 14, 2009 at 11:32AM I came across a tricky problem today. I had used Maven to create a simple Java web application that I have been building upon. I got to the point where I wanted to use some JSTL tags in my presentation layer. Oddly enough the raw tags were being ignored and showing up in the HTML output. The problem turned out to be the usage of an older version of the web.xml file that Maven had generated. The 2.3 version uses a Doctype, and does not support the JSTL tags:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" >
If you want your web app to process JSTL tags, you should update this file to use a 2.4 syntax instead. The 2.4 version uses an XML schema instead of DTD to validate, so remove the above mentioned section and replace with the following:
<web-app id="myApp" version="2.4" 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">
tagged
Java,
Maven in
Java,
Web Development
Java,
Maven in
Java,
Web Development





