A JSTL Tutorial by Examples 


March 23, 2010 01:43:47    Last update: September 03, 2010 14:21:15
This is a bare bones, no frills, just the facts tutorial on JSTL. I will not bother you with theories, principles, best practices, anecdotes, or any other junk, because JSTL is shallow and simple, and I don't want to make it sound deep or complex.

Getting ready
  1. JSTL/JSP Expression Language
  2. JSTL implicit variables
  3. A simple test application for JSTL
  4. Expanding the simple JSTL test application

Core Tags
  1. Basic tags: <c:out>, <c:set>, <c:remove>, <c:catch>
  2. Flow control tags: <c:if>, <c:choose>, <c:when>, <c:otherwise>, <c:forEach>, <c:forTokens>
  3. URL Tags: <c:import>, <c:url>, <c:redirect>, <c:param>

Internationalization (i18n) and formatting tags
  1. I18N Overview
  2. Set locale: <fmt:setLocale>, <fmt:requestEncoding>
  3. Format messages: <fmt:message>, <fmt:bundle>, <fmt:setBundle>, <fmt:param>
  4. Format number and date: <fmt:formatNumber>, <fmt:parseNumber>, <fmt:formatDate>, <fmt:parseDate>, <fmt:setTimeZone>, <fmt:timeZone>

SQL tags
SQL tags are used to run SQL statements. I don't know why they are in JSTL, but since they are, you can use them if you want to.
  1. Set datasource: <sql:setDataSource>
  2. Query: <sql:query>, <sql:param>
  3. Update and transaction: <sql:update>, <sql:param>, <sql:dateParam>, <sql:transaction>,

  1. Collection length: <fn:length>
  2. String manipulation functions: <fn:toUpperCase>, <fn:toLowerCase>, <fn:substring>, <fn:substringAfter>, <fn:substringBefore>, <fn:trim>, <fn:replace>, <fn:indexOf>, <fn:startsWith>, <fn:endsWith>, <fn:contains>, <fn:containsIgnoreCase, <fn:split>, <fn:join>, <fn:escapeXml>

XML tags
  1. Overview
  2. XML core tags: <x:parse>, <x:out>, <x:set>
  3. XML flow control tags: <x:if>, <x:choose>, <x:when>, <x:otherwise>, <x:forEach>
  4. XML transform tags: <x:transform>, <x:param>

Share |
| Comment  | Tags