<document>
  <header>
    <product>resin</product>
    <title>JSTL standard template library for JSP</title>
    <version>Resin 3.0</version>
    <description>
      <p>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.
      </p>

      <p>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.</p>

    </description>
  </header>

  <body>
    <summary/>

    <s1 title="JSTL support in Resin is enabled by default">
      <p>Because Resin automatically adds JSTL support, applications can
        start using JSTL by adding the taglib to the JSP without
        additional configuration:</p>

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

      <p>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.xml:</p>
      
      <example title="Disabling fast JSTL">
&lt;caucho.com&gt;
&lt;http-server&gt;
  &lt;jsp fast-jstl='false'/&gt;
  ...
&lt;/http-server&gt;
&lt;/caucho.com&gt;
      </example>

      <p>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.</p>

    </s1>

    <s1 title="Velocity syntax maps to JSTL core">

      <p>Resin's experimental 
        <a href="jsp-velocity.xtp">Velocity-style syntax</a> now maps
        directly to JSTL tags, providing a more standard basis for the
        Velocity-style syntax.</p>

      <p>Velocity-style syntax can either be enabled on a per-JSP page with
        <var>velocity='true'</var> or in the web-app with the &lt;jsp&gt; tag:</p>
      
      <example title="Enabling velocity for a web-app">
&lt;web-app&gt;
  &lt;jsp velocity='true'/&gt;
  ...
&lt;/web-app&gt;
          </example>

      <p>An example use of the Velocity-style syntax would be:</p>

      <example title="Velocity style">
&lt;jsp:directive.page velocity='true'/&gt;
#{
int count;
}#

&lt;h3&gt;A sample $\{count}&lt;/h3&gt;

#if ("foo" == params.a)
  &lt;h3&gt;Foo!&lt;/h3&gt;
#else
  &lt;h3&gt;Bar!&lt;/h3&gt;
#end
      </example>

      <p>The above page is equivalent to the following JSP page using
        JSTL:</p>

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

&lt;h3&gt;A sample &lt;c:out value="${'${'}count}"/&gt;&lt;/h3&gt;

&lt;c:choose&gt;
&lt;c:when test="${'${'}'foo' == params.a}"&gt;
  &lt;h3&gt;Foo!&lt;/h3&gt;
&lt;/c:when&gt;
&lt;c:otherwise&gt;
  &lt;h3&gt;Bar!&lt;/h3&gt;
&lt;/c:otherwise&gt;
&lt;/c:choose&gt;
      </example>
    </s1>

  </body>
</document>