Standard Tag Library for JavaServer Pages

What is the JavaServer Pages Standard Tag Library (JSTL) ?

JSTL is the Java Server Pages Standard Tag Library.

JSTL has support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization tags, and SQL tags. It also provides a framework for integrating existing custom tags with JSTL tags.

JSTL encapsulates, as simple tags, core functionality common to many JSP applications. JSTL is part of the Java EE API and included in most servlet containers. But to use JSTL in our JSP pages, we need to download the JSTL jars for your servlet container. Most of the times, you can find them in the example projects and you can use them. You need to include these libraries in the project WEB-INF/lib directory. These jars are container specific, for example in Tomcat, we need to include jstl.jar and standard.jar jar files in project build path.

Here are a few examples of JSTL tags:

out – Like <%= … >, but for expressions.
catch -    Catches any Throwable that occurs in its body and optionally exposes it.
choose – Simple conditional tag that establishes a context for mutually exclusive conditional operations, marked by <when> and <otherwise>, as seen in the plugin described here: how to disable comments in WordPress
if – Simple conditional tag, which evalutes its body if the supplied condition is true and optionally exposes a Boolean scripting variable representing the evaluation of this condition
import – Retrieves an absolute or relative URL and exposes its contents to either the page, a String in ‘var’, or a Reader in ‘varReader’.
forEach – The basic iteration tag, accepting many different collection types and supporting subsetting and other functionality