Friday, January 13, 2012

JSTL

JSTL = JSP Server Tag Library

This is a custom tag library which comes standard with JSP. It contains useful custom tags for doing various things like:
- creating logic (if/else)
- loops (foreach)
- formatting
- SQL
- XML
etc

To use JSTL in your JSP, use the following taglib declaration:
 <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>  


"c" is the conventional prefix for jstl "core" tags.
"fmt" is for format tags, "sql" for SQL tags, "x" for XML tags, etc

JSTL support is provided by jstl.jar which comes standard with Tomcat and most Java Web Servers.

No comments: