URI HELL: Juggling JSTL Taglib URI settings in JSP pages
Posted : June 3, 2004 at 2:13 pm [America/Los_Angeles]

I read Matt’s tip about JSTL URI settings in JSP 2.0 in haste and ended up paying a couple of hours of my time on what I fondly will henceforth refer to as “URI Hell”
.
Here’s a shorter version of my findings:
In Tomcat 4.x, you must use jakarta-taglibs 1.0.5 and when you want to use JSTL in your JSP pages, use:
<%@ taglib prefix=”c” uri=”http://java.sun.com/jstl/core” %> In Tomcat 5.x, you should use jakarta-taglibs 1.1.0 and when you want to use JSTL in your JSP pages, use:
<%@ taglib prefix=”c” uri=”http://java.sun.com/jsp/jstl/core” %> Notice the additonal /jsp/ in the URI when using the taglibs in Tomcat 5.x
Of course, you could use jakarta-taglibs 1.0.5 version with Tomcat 5.x (which is really what Matt’s tip was all about), and that’s when
the can of worms or “URI Hell” is really unleashed. I summarize below my findings with the permutations and combinations that I had time to
test:
Tomcat version:
4.1.29
JSTL library version:
1.0.5
Servlet/jsp spec:
2.3/1.2
Web-app entry in web.xml:
<!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>
Taglib prefix used:
<%@ taglib prefix=”c” uri=”http://java.sun.com/jstl/core” %>
Tomcat version: 5.0.26 JSTL library version: 1.1.0 servlet/jsp spec: 2.4/2.0 web-app entry in web.xml: <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″> taglib prefix used: <%@ taglib prefix=”c” uri=”http://java.sun.com/jsp/jstl/core” %>
Tomcat version: 5.0.26 JSTL library version: 1.0.5 servlet/jsp spec: 2.3/1.2 web-app entry in web.xml: <!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> taglib prefix used: <%@ taglib prefix=”c” uri=”http://java.sun.com/jstl/core” %>
Tomcat version: 5.0.26 JSTL library version: 1.0.5 servlet/jsp spec: 2.4/2.0 web-app entry in web.xml: <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″> taglib prefix used: <%@ taglib prefix=”c” uri=”http://java.sun.com/jstl/core_rt” %>
Did I hear you yell “Velocity. Duh…” 
- Anand
Category: Application Development