JSTL tags on JSP page do not work and appear plain in HTML page source

The JSTL tags appear in the HTML source, this is not right. It is supposed to run in the server side, and disappear completely in the HTML output. This can happen if you didn’t declare the taglib in top of JSP. Add the following line to the top of your JSP to get the JSTL core tags to run:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

If this in turn results in a complaint of a missing TLD URI in the server logs, then you need to ensure that you’ve installed JSTL. Perhaps you’re running a container which doesn’t ship with JSTL builtin, such as Tomcat or Jetty.

See also:

Leave a Comment