JSTL standard template library for JSPResin 3.0
Resin 3.0

Features
Installation
Configuration
Web Applications
IOC/AOP
Resources
JSP
Servlets and Filters
Portlets
Databases
Admin (JMX)
CMP
EJB
Amber
EJB 3.0
Security
XML and XSLT
XTP
JMS
Performance
Protocols
Third-party
Troubleshooting/FAQ

Introduction
JSP Compilation
Reference
Tutorials
Articles
FAQ

JSP EL
JSTL
Directives
Variables
Actions
Applications
Velocity
Schema for JSP-2.0 .tld files
JSP EL
Reference
Directives

JSTL provides standard actions for functionality most often needed by page authors. This functionality includes a core library for the most common tasks, internationalization (i18n) and text formatting, relational database access (SQL), and XML processing.

Resin can generate more efficient code for JSTL than for other tag libraries. It is recommended that applications use JSTL as a basis for any JSP pages which can use it.

  1. JSTL support in Resin is enabled by default
  2. Velocity syntax maps to JSTL core

JSTL support in Resin is enabled by default

Because Resin automatically adds JSTL support, applications can start using JSTL by adding the taglib to the JSP without additional configuration:

Using c:out and c:if
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core' %>
<c:if test="${param.test='a'}">
  <c:out value="The parameter is ${param.test}"/>
</c:if>
      

For several of the more important tags, Resin's JSP compiler will generate more efficient code than is possible with the straight tag library. This "fast-jstl" can be disabled in the resin.conf:

Disabling fast JSTL
<caucho.com>
<http-server>
  <jsp fast-jstl='false'/>
  ...
</http-server>
</caucho.com>
      

Because any bugs in the tag libraries are specific to the tag, even when using Resin in combination with another JSTL implementation, please report the specific tag and tag usage for JSTL bugs.

Velocity syntax maps to JSTL core

Resin's experimental Velocity-style syntax now maps directly to JSTL tags, providing a more standard basis for the Velocity-style syntax.

Velocity-style syntax can either be enabled on a per-JSP page with velocity='true' or in the web-app with the <jsp> tag:

Enabling velocity for a web-app
<web-app>
  <jsp velocity='true'/>
  ...
</web-app>
          

An example use of the Velocity-style syntax would be:

Velocity style
<jsp:directive.page velocity='true'/>
#{
int count;
}#

<h3>A sample ${count}</h3>

#if ("foo" == params.a)
  <h3>Foo!</h3>
#else
  <h3>Bar!</h3>
#end
      

The above page is equivalent to the following JSP page using JSTL:

JSTL equivalent
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core' %>
<jsp:scriptlet>
int count;
</jsp:scriptlet>

<h3>A sample <c:out value="${count}"/></h3>

<c:choose>
<c:when test="${'foo' == params.a}">
  <h3>Foo!</h3>
</c:when>
<c:otherwise>
  <h3>Bar!</h3>
</c:otherwise>
</c:choose>
      


JSP EL
Reference
Directives
Copyright © 1998-2005 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark, and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.