- Details
- Written by Nam Ha Minh
- Last Updated on 26 July 2019   |   Print Email
Table of Contents:
1.Core Tags
2.Formatting Tags
3.SQL Tags
4.XML Tags
5.JSTL Tag Reference Sample Application
6.Download Eclipse project/WAR file
A comprehensive reference of JSTL tags:
The following sections discuss in details the four types of tag libraries along with examples which are applicable. Please click on each tag to access information about tag usage and working examples.
JSTL Core Tags:
To use core tags in the JSP specify the following directive at the beginning of the JSP.
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
JSTL Formatting Tags:
To use formatting tags in the JSP specify the following directive at the beginning of the JSP.
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
JSTL SQL Tags:
To use the SQL tags in the JSP specify the following directive at the beginning of the JSP.
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
JSTL XML Tags:
To use the XML tags in the JSP specify the following directive at the beginning of the JSP.
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
JSTL Tag Reference - Sample Application:
The sample Eclipse project contains the working examples for all the four types of JSTL tags. The Eclipse project structure is shown below:
The project’s starting point is
/JSTL-Reference/jstl-tag-reference.jsp. If you’ve deployed this web application in your local Tomcat, the URL to access the JSTL Reference web application is:
http://localhost:8080/JSTL-Tag-Reference/jstl-tag-reference.jsp
The
Employee.sql contains the database table script used in this project.
Once you deployed the WAR file to the server, please click on respective tag type to access the full table of contents for each tag type selected. The four following screen captures display each tag type access pages and their respective tags.
JSTL SQL Tags - http://localhost:8080/JSTL-Tag-Reference/tag-types/sql-tag-reference.jsp
[Please ensure the database server is up and running when accessing JSTL SQL tags]. JSTL XML Tags -
http://localhost:8080/JSTL-Tag-Reference/tag-types/xml-tag-reference.jsp Download Eclipse Project / WAR file
Please download Eclipse project and deployable .war file in the attachments section.
Other JSTL Tutorials:
About the Author:
Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He started programming with Java in the time of Java 1.4 and has been falling in love with Java since then. Make friend with him on
Facebook and watch
his Java videos you YouTube.