122
JSTL (JSP Standard Tag Library)
The JSP Standard Tag Library (JSTL) represents a set of tags to simplify the JSP development.
Advantage of JSTL
- Fast Development JSTL provides many tags that simplify the JSP.
- Code Reusability We can use the JSTL tags on various pages.
- No need to use scriptlet tag It avoids the use of scriptlet tag.
JSTL Tags
There JSTL mainly provides five types of tags:
Tag Name | Description |
---|---|
Core tags | The JSTL core tag provide variable support, URL management, flow control, etc. The URL for the core tag is http://java.sun.com/jsp/jstl/core. The prefix of core tag is c. |
Function tags | The functions tags provide support for string manipulation and string length. The URL for the functions tags is http://java.sun.com/jsp/jstl/functions and prefix is fn. |
Formatting tags | The Formatting tags provide support for message formatting, number and date formatting, etc. The URL for the Formatting tags is http://java.sun.com/jsp/jstl/fmt and prefix is fmt. |
XML tags | The XML tags provide flow control, transformation, etc. The URL for the XML tags is http://java.sun.com/jsp/jstl/xml and prefix is x. |
SQL tags | The JSTL SQL tags provide SQL support. The URL for the SQL tags is http://java.sun.com/jsp/jstl/sql and prefix is sql. |
For creating JSTL application, you need to load the jstl.jar file.
Download the jstl.jar file
JSTL Index
JSTL Tutorial
JSTL Core Tags
- 14 JSTL Core Tags
- 1) c:out
- 2) c:import
- 3) c:set
- 4) c:remove
- 5) c:catch
- 6) c:if
- 7) c:choose
- 8) c:when
- 9) c:otherwise
- 10) c:forEach
- 11) c:forTokens
- 12) c:param
- 13) c:redirect
- 14) c:url
JSTL Function Tags
- 15 JSTL Function Tags
- 1) fn:contains()
- 2) fn:containsIgnore..
- 3) fn:endsWith()
- 4) fn:escapeXml()
- 5) fn:indexOf()
- 6) fn:trim()
- 7) fn:startsWith()
- 8) fn:split()
- 9) fn:toLowerCase()
- 10) fn:toUpperCase()
- 11) fn:substring()
- 12) fn:substringAfter()
- 13) fn:substringBefore()
- 14) fn:length()
- 15) fn:replace()
JSTL Formatting Tags
- 9 JSTL Formatting Tags
- 1) fmt:parseNumber
- 2) fmt:timeZone
- 3) fmt:formatNumber
- 4) fmt:parseDate
- 5) fmt:bundle
- 6) fmt:setTimeZone
- 7) fmt:setBundle
- 8) fmt:message
- 9) fmt:formatDate
JSTL XML Tags
- 9 JSTL XML Tags
- 1) x:out
- 2) x:parse
- 3) x:set
- 4) x:choose
- 5) x:when
- 6) x:otherwise
- 7) x:if
- 8) x:transform
- 9) x:param
JSTL SQL Tags
Next TopicJSTL Core Tags