JSTL - or the Java Standard Tag Library - provides the core functionality common to many Web applications. 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.
But what exactly is a tag? A tag is a JSP construct used to invoke some built-in code. It's similar to a function or a language construct (like include) in other languages.
A simple example is the jsp:include tag:
<jsp:include page="footer.jsp" >
<jsp:param name="extrainfo" value="myinfo" />
</jsp:include>
The meaning is simple and analogous to the C/C++ #include directive. While this is not a JSTL tag, it's similar in every way to one. JSTL tags are placed in 5 categories:
- JSTL core (c:if, c:when, c:catch etc.)
- JSTL formatting (fmt:message, fmt:parseDate, fmt:parseNumber etc.)
- JSTL SQL (sql:query, sql:update, sql:transaction)
- JSTL XML (xml:parse, xml:transform, xml:forEach etc.)
- JSTL functions (fn:substring, fn:indexOf, fn:join etc.)
The full list of tags and their arguments can be seen on the official Java JSTL page.
It should be noted that any programmer can create his own custom tag library by writing a Java class. The two requirements are that this class implements one of the Tag interfaces and that the programmer provides a tag library XML
description file that specifies the tags and the java classes that
implement the tags.