Tag Archives: JSTL

JSF JSTL Twin Tag Libraries ( Difference between JSTL taglibs “core_rt” and “core” and other explained)

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>

Download links for MyFaces v1.2.9, JSTL v1.2, Trinidad v1.2.13

For some reason, the below jars download links are not available in the apache main download home page.

 MyFaces v1.2.9,  Trinidad v1.2.13

I managed find the links for required jars given below
http://archive.apache.org/dist/myfaces/binaries/trinidad-1.2.13-dist.zip
http://archive.apache.org/dist/myfaces/binaries/myfaces-core-1.2.9-bin.zip

Check the below link for any other missing binaries from main apache site home page downloads
http://archive.apache.org/dist/myfaces/binaries/

JSTL 1.2 jar download location is given below
http://download.java.net/maven/glassfish/javax/servlet/jsp/jstl/jstl-api/1.2/jstl-api-1.2.jar
http://download.java.net/maven/glassfish/javax/servlet/jsp/jstl/jstl-api/1.2/jstl-api-1.2.jar