The JSTL tag library comes in two flavors that differ only in the way they support the use of runtime expressions for attribute values.
One library supports the request time expression values, and another supports the expression language.
The URIs of the RT-based tag libraries simply have the “_rt” suffix appended.
EL-based tag libraries:
Functional Area URI Prefix
Core http://java.sun.com/jstl/core c
XML Processing http://java.sun.com/jstl/xml x
Internationalization http://java.sun.com/jstl/fmt fmt
Database Access http://java.sun.com/jstl/sql sql
Runtime-based tag libraries
Functional Area URI Prefix
Core http://java.sun.com/jstl/core_rt c_rt
XML Processing http://java.sun.com/jstl/xml_rt x_rt
Internationalization http://java.sun.com/jstl/fmt_rt fmt_rt
Database Access http://java.sun.com/jstl/sql_rt sql_rt
To use an EL-based JSTL library, we must declare the library using a taglib directive, similar to declaring a regular custom tag library:
<@ taglib prefix=”c” uri=”http://java.sun.com/jstl/core”>
To use a runtime-based JSTL tag library, we must declare the library using a taglib directive as below
<@ taglib prefix=”c_rt” uri=”http://java.sun.com/jstl/core_rt”>
What does Core Tag Library supports?
It supports actions, including – output, manipulation of scoped variables, conditional logic, loops, URL manipulation, and error handling.
Other General Purpose Tags are for writing data, saving data to memory, deleting data, and handling errors:<c:out>, <c:set>, <c:remove>, and
<c:catch>.
we can use <c:out> to write data, as in the following example:
The name of your country is:
<c:out value=”${person.country}” default=”unknown”/>
Conditional Actions:
The JSTL conditional actions supports simple conditional execution like <c:if> and mutually exclusive conditional execution
using <c:choose>, <c:when>, and <c:otherwise>.
The <c:if> tag allows us to conditionally include a piece of the page, depending on runtime information.
For example, the following snippet of code checks if a customer is based in India:
<c:if test=”${customer.country == ‘India’}”>
This customer is based in India
</c:if>

0 Comments.