Abbey Workshop

JSP: JSTL Expressions Ignored

I ran across across a nasty problem today. Here is the deal. I have the JSP Standard Tag Library 1.1 (JSTL) installed on Tomcat 5.5.9. None of the expressions JSTL expressions work when the JSP page is executed. The syntax of the tags is correct. All the correct libraries are installed. But when you have something like this ${1+2} instead of getting a result of 3 you get ${1+2}.

The solution? Well thanks to the dudes here it turns out that this problem is caused by having the wrong version of the web.xml file in your web applications WEB-INF directory. Being the dim witted monkey boy that I am, I followed the Apache installation instructions and actually setup a sample directory hierarchy linked to in the documentation. Well the sample used a version 2.3 web.xml file instead of a versioni 2.4 web.xml file. You can tell the difference in two ways. The root element of both files identifies which version of the file it is. In addition, the 2.3 web.xml file uses a DTD while the 2.4 web.xml file uses a schema.

Replace the 2.3 file with the 2.4 and everything works just fine. I just hope that this note helps a few other people save a couple of hours of work.