7
Most read
19
Most read
22
Most read
O r g a n i za t i o n n a m e
Presented by
 Introduction to JSTL
 Categories
 JSTL Core
 JSTL Formatting
 JSTL SQL
 JSTL XML
 JSTL functions
Reference The Complete Reference JSP 2.0 by -Phil Hanna
2J S T L
• JSP Standard Tag Library(JSTL) is a standard
library of custom tags. The JSTL contain
several tag that can remove scriplet code from
a JSP page.
What is JSTL?
3J S T L
Conti..
• JSP Standard Tag Library (JSTL) is the standard
tag library that provides tags to control the JSP
page behavior, iteration and control statements,
internationalization tags, and SQL tags.
•To use JSTL the jar files like Jstl.jar , standard.jar
files are neccesary.
4J S T L
5 categories
• JSTL Core.
• JSTL Formatting.
• JSTL SQL.
• JSTL XML.
• JSTL functions.
5J S T L
JSTL core
• Core tags provide support for iteration, conditional
logic, catch exception, url, forward or redirect
response etc. To use JSTL core tags, we should
include it in the JSP page like below.
• <%@ taglib
uri="http://java.sun.com/jsp/jstl/co
re" prefix="c" %>
6J S T L
JSTL Formatting
• These tags are provided for formatting of Numbers,
Dates and i18n support through locales and resource
bundles. We can include these tags in JSP with below
syntax
• <%@ taglib
uri="http://java.sun.com/jsp/jstl/fm
t" prefix="fmt" %>
7J S T L
JSTL SQL
• JSTL SQL Tags provide support for interaction with
relational databases such as Oracle, MySQL etc.
Using SQL tags we can run database queries, we
include it in JSP with below syntax
• <%@ taglib
uri="http://java.sun.com/jsp/jstl/sq
l" prefix="sql" %>
8J S T L
JSTL XML
• XML tags are used to work with XML documents such
as parsing XML, transforming XML data and XPath
expressions evaluation. Syntax to include XML tags in
JSP page
• <%@ taglib
uri="http://java.sun.com/jsp/jstl/xm
l" prefix="x" %>
9J S T L
JSTL Functions
• JSTL tags provide a number of functions that we can
use to perform common operation, most of them are
for String manipulation such as String Concatenation,
Split String etc. Syntax to include JSTL functions in JSP
page
• <%@ taglib
uri="http://java.sun.com/jsp/jstl/fu
nctions" prefix="fn" %>
10J S T L
Library URI Prefix
Core http://java.sun.com/jsp/jstl/core c
XML Processing http://java.sun.com/jsp/jstl/xml x
Formatting http://java.sun.com/jsp/jstl/fmt fmt
Database Access http://java.sun.com/jsp/jstl/sql sql
Functions http://java.sun.com/jsp/jstl/functions fn
JSTL URIs and Default Prefixes
11J S T L
JSTL Core Tags
Tags Description
<c:out>
To write something in JSP page, we can use EL also with
this tag
<c:import> Same as <jsp:include> or include directive
<c:redirect> redirect request to another resource
<c:set> To set the variable value in given scope.
<c:remove> To remove the variable from given scope
<c:catch> To catch the exception and wrap it into an object.
<c:if>
Simple conditional logic, used with EL and we can use it
to process the exception from <c:catch>
<c:choose>
Simple conditional tag that establishes a context for
mutually exclusive conditional operations, marked by
<c:when> and <c:otherwise>
12J S T L
Core Tags Library
Tag Descriptor
<c:when>
Sub tags of <c:choose> that includes its body if its
condition evaluates to ‘true’.
<c:otherwise>
Sub tags of <c:choose> that includes its body if its
condition evaluates to ‘false’.
<c:forEach> for iteration over a collection
<c:forTokens> for iteration over tokens separated by a delimiter.
<c:param> used with <c:import> to pass parameters
<c:url>
to create a URL with optional query string
parameters
13J S T L
Format Tags
Tags Description
<fmt:formatNumber>
To render numerical value with specific
precision or format.
<fmt:parseNumber>
Parses the string representation of a
number, currency, or percentage.
<fmt:formatDate>
Formats a date and/or time using the
supplied styles and pattern
<fmt:parseDate>
Parses the string representation of a date
and/or time
<fmt:bundle>
Loads a resource bundle to be used by its
tag body.
<fmt:setLocale>
Stores the given locale in the locale
configuration variable.
14J S T L
Format Tags
Tags Description
<fmt:setBundle>
Loads a resource bundle and stores it in the
named scoped variable or the bundle
configuration variable.
<fmt:timeZone>
Specifies the time zone for any time
formatting or parsing actions nested in its
body.
<fmt:setTimeZone>
Stores the given time zone in the time zone
configuration variable
<fmt:message> To display an internationalized message.
<fmt:requestEncodin
g>
Sets the request character encoding
15J S T L
SQL Tags
Tags Description
<sql:setDataSource>
Creates a simple DataSource suitable only for
prototyping
<sql:query>
Executes the SQL query defined in its body or through
the sql attribute.
<sql:update>
Executes the SQL update defined in its body or
through the sql attribute.
<sql:param>
Sets a parameter in an SQL statement to the specified
value.
<sql:dateParam>
Sets a parameter in an SQL statement to the specified
java.util.Date value.
<sql:transaction >
Provides nested database action elements with a
shared Connection, set up to execute all statements
as one transaction.
16J S T L
XML tags
Tags Description
<x:parse>
Use to parse XML data specified either via an
attribute or in the tag body.
<x:set >
Sets a variable to the value of an XPath
expression.
<x:if >
Evaluates a test XPath expression and if it is
true, it processes its body. If the test
condition is false, the body is ignored.
<x:forEach> To loop over nodes in an XML document.
<x:choose>
Simple conditional tag that establishes a
context for mutually exclusive conditional
operations, marked by <when> and
<otherwise>
<x:when >
Subtag of <choose> that includes its body if
its expression evalutes to 'true'
17J S T L
XML Tags
Tag Descriptor
<x:otherwise >
Subtag of <choose> that follows <when>
tags and runs only if all of the prior
conditions evaluated to 'false'
<x:transform >
Applies an XSL transformation on a XML
document
<x:param >
Use along with the transform tag to set a
parameter in the XSLT stylesheet
18J S T L
Functions
Function Description
fn:contains()
Tests if an input string contains the specified
substring.
fn:containsIgnoreCase()
Tests if an input string contains the specified
substring in a case insensitive way.
fn:endsWith()
Tests if an input string ends with the specified
suffix.
fn:escapeXml()
Escapes characters that could be interpreted
as XML markup.
fn:indexOf()
Returns the index withing a string of the first
occurrence of a specified substring.
fn:join() Joins all elements of an array into a string.
19J S T L
Function Description
fn:replace()
Returns a string resulting from replacing in an
input string all occurrences with a given
string.
fn:split() Splits a string into an array of substrings.
fn:startsWith()
Tests if an input string starts with the
specified prefix.
fn:substring() Returns a subset of a string.
fn:substringAfter()
Returns a subset of a string following a
specific substring.
fn:substringBefore()
Returns a subset of a string before a specific
substring.
20J S T L
Tags Description
fn:toLowerCase()
Converts all of the characters of a string to
lower case.
fn:toUpperCase()
Converts all of the characters of a string to
upper case.
fn:trim()
Removes white spaces from both ends of a
string.
21J S T L
J S T L 22

More Related Content

PPTX
JavaFX Presentation
PPTX
Java/Servlet/JSP/JDBC
PPT
PPTX
Installing JDK and first java program
PPT
Java web services
PPTX
Ajax and Jquery
PDF
Introduction to Java 11
PPTX
JavaFX Presentation
Java/Servlet/JSP/JDBC
Installing JDK and first java program
Java web services
Ajax and Jquery
Introduction to Java 11

What's hot (20)

PPTX
Java Server Pages(jsp)
PPT
Java Servlets
PPTX
Event handling
PPTX
Event Handling in java
PDF
JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
PPS
Jdbc architecture and driver types ppt
PPTX
Java swing
PDF
Android notification
PPTX
Hibernate ppt
PPTX
Java Data Types
PPT
Java operators
PPS
Jsp element
PPTX
enterprise java bean
PPTX
Exception Handling in C#
PPTX
Session bean
PPTX
Android User Interface
PPTX
Event In JavaScript
PPSX
JDBC: java DataBase connectivity
PPT
MYSQL - PHP Database Connectivity
Java Server Pages(jsp)
Java Servlets
Event handling
Event Handling in java
JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
Jdbc architecture and driver types ppt
Java swing
Android notification
Hibernate ppt
Java Data Types
Java operators
Jsp element
enterprise java bean
Exception Handling in C#
Session bean
Android User Interface
Event In JavaScript
JDBC: java DataBase connectivity
MYSQL - PHP Database Connectivity
Ad

Viewers also liked (20)

PPT
JSP Standart Tag Lİbrary - JSTL
PDF
JSP Standard Tag Library
PDF
Basic JSTL
PPT
PPT
MVC ppt presentation
PDF
Model View Controller (MVC)
PPT
Session 7 : jstl - Giáo trình Bách Khoa Aptech
PPTX
PPTX
Təhlükəsiz proqram təminatının java mühitində hazırlanma texnologiyaları
PPT
Fişinqdən necə qorunmaq olar?
PPTX
Java proqramlaşdirma mühitində təhlükəsiz proqram təminatinin hazirlanma texn...
PPTX
Struts introduction
PPT
PPTX
Operators and Expressions in Java
PPTX
PDF
Introduction to Struts 1.3
PPT
java packages
PPTX
Dynamic HTML (DHTML)
PPSX
Data types, Variables, Expressions & Arithmetic Operators in java
JSP Standart Tag Lİbrary - JSTL
JSP Standard Tag Library
Basic JSTL
MVC ppt presentation
Model View Controller (MVC)
Session 7 : jstl - Giáo trình Bách Khoa Aptech
Təhlükəsiz proqram təminatının java mühitində hazırlanma texnologiyaları
Fişinqdən necə qorunmaq olar?
Java proqramlaşdirma mühitində təhlükəsiz proqram təminatinin hazirlanma texn...
Struts introduction
Operators and Expressions in Java
Introduction to Struts 1.3
java packages
Dynamic HTML (DHTML)
Data types, Variables, Expressions & Arithmetic Operators in java
Ad

Similar to jstl ( jsp standard tag library ) (20)

PPTX
JSP Standard Tag Library
PDF
Jsp standard tag_library
PDF
Session_15_JSTL.pdf
PPTX
Jsp tag library
PPTX
Jsp session 13
PPTX
Jsp session 9
PPTX
JSTL.pptx
PPTX
Implementing java server pages standard tag library v2
PDF
JSP Technology II
PPT
Jstl Guide
PPTX
Advance java session 16
PDF
Lecture 5 JSTL, custom tags, maven
PPTX
Jsp and jstl
PDF
26xslt
PPTX
Introduction to JSP
PPT
XML/XSLT
PPTX
Xml session
PPT
PPTX
eXtensible Markup Language (XML)
PPTX
Introduction to XSLT
JSP Standard Tag Library
Jsp standard tag_library
Session_15_JSTL.pdf
Jsp tag library
Jsp session 13
Jsp session 9
JSTL.pptx
Implementing java server pages standard tag library v2
JSP Technology II
Jstl Guide
Advance java session 16
Lecture 5 JSTL, custom tags, maven
Jsp and jstl
26xslt
Introduction to JSP
XML/XSLT
Xml session
eXtensible Markup Language (XML)
Introduction to XSLT

More from Adarsh Patel (14)

PPTX
CMACs and MACS based on block ciphers, Digital signature
PPTX
4G 5G technology
PPTX
Loaders ( system programming )
PPTX
Non Linear Data Structures
PPTX
8255:ppi & 8259:pic
PPTX
case study of curve fitting
PPTX
basics of virtual memory
PPTX
synchronous state machine design
PPTX
projection of solid
PPTX
basic electronics, Transmission lines, wave guides And Antenna fundamental
PPTX
linear equations
PPT
Radioactive pollution
PPTX
Perfect Bookreview - you can win
PPTX
mechanical engineering transmission of motion and power
CMACs and MACS based on block ciphers, Digital signature
4G 5G technology
Loaders ( system programming )
Non Linear Data Structures
8255:ppi & 8259:pic
case study of curve fitting
basics of virtual memory
synchronous state machine design
projection of solid
basic electronics, Transmission lines, wave guides And Antenna fundamental
linear equations
Radioactive pollution
Perfect Bookreview - you can win
mechanical engineering transmission of motion and power

Recently uploaded (20)

PPT
444174684-Welding-Presentatiohhhn-ppt.ppt
PPTX
formulation and evaluation of polyherbal antiageing cream
PDF
CV of Architect Professor A F M Mohiuddin Akhand.pdf
PPTX
Coordination Compuch flasks didiinds.pptx
PPTX
E-commerce Security and Fraud Issues and Protection
PPT
notes_Lecture2 23l3j2 dfjl dfdlkj d 2.ppt
PDF
servsafecomprehensive-ppt-full-140617222538-phpapp01.pdf
PPT
Woman as Engineer and Technicians in the field of Clinical & Biomedical Engin...
PPTX
Opioid_Analgesics_Presentation (1).pptxp
PDF
CollegePresentation.pdf hsjsisjsjsjsssoo
PPTX
Creating-a-Personal-Blockchain-Portfolio-for-Developers-and-Experts.pptx
PDF
iTop VPN Crack Latest Version 2025 Free Download With Keygen
PPTX
mathsportfoliomanvi-211121071838 (1).pptx
PPTX
ANN DL UNIT 1 ANIL 13.10.24.pptxcccccccccc
PDF
Acne presentation and homeopathy treatment
PDF
Environmental-social-and-governance-report.pdf
PPTX
employee on boarding for jobs for freshers try it
PPTX
ChandigarhUniversityinformationcareer.pptx
PPTX
Session 4 of vibale oldin sink about vola
PPTX
Digital Education Presentation for students.
444174684-Welding-Presentatiohhhn-ppt.ppt
formulation and evaluation of polyherbal antiageing cream
CV of Architect Professor A F M Mohiuddin Akhand.pdf
Coordination Compuch flasks didiinds.pptx
E-commerce Security and Fraud Issues and Protection
notes_Lecture2 23l3j2 dfjl dfdlkj d 2.ppt
servsafecomprehensive-ppt-full-140617222538-phpapp01.pdf
Woman as Engineer and Technicians in the field of Clinical & Biomedical Engin...
Opioid_Analgesics_Presentation (1).pptxp
CollegePresentation.pdf hsjsisjsjsjsssoo
Creating-a-Personal-Blockchain-Portfolio-for-Developers-and-Experts.pptx
iTop VPN Crack Latest Version 2025 Free Download With Keygen
mathsportfoliomanvi-211121071838 (1).pptx
ANN DL UNIT 1 ANIL 13.10.24.pptxcccccccccc
Acne presentation and homeopathy treatment
Environmental-social-and-governance-report.pdf
employee on boarding for jobs for freshers try it
ChandigarhUniversityinformationcareer.pptx
Session 4 of vibale oldin sink about vola
Digital Education Presentation for students.

jstl ( jsp standard tag library )

  • 1. O r g a n i za t i o n n a m e Presented by
  • 2.  Introduction to JSTL  Categories  JSTL Core  JSTL Formatting  JSTL SQL  JSTL XML  JSTL functions Reference The Complete Reference JSP 2.0 by -Phil Hanna 2J S T L
  • 3. • JSP Standard Tag Library(JSTL) is a standard library of custom tags. The JSTL contain several tag that can remove scriplet code from a JSP page. What is JSTL? 3J S T L
  • 4. Conti.. • JSP Standard Tag Library (JSTL) is the standard tag library that provides tags to control the JSP page behavior, iteration and control statements, internationalization tags, and SQL tags. •To use JSTL the jar files like Jstl.jar , standard.jar files are neccesary. 4J S T L
  • 5. 5 categories • JSTL Core. • JSTL Formatting. • JSTL SQL. • JSTL XML. • JSTL functions. 5J S T L
  • 6. JSTL core • Core tags provide support for iteration, conditional logic, catch exception, url, forward or redirect response etc. To use JSTL core tags, we should include it in the JSP page like below. • <%@ taglib uri="http://java.sun.com/jsp/jstl/co re" prefix="c" %> 6J S T L
  • 7. JSTL Formatting • These tags are provided for formatting of Numbers, Dates and i18n support through locales and resource bundles. We can include these tags in JSP with below syntax • <%@ taglib uri="http://java.sun.com/jsp/jstl/fm t" prefix="fmt" %> 7J S T L
  • 8. JSTL SQL • JSTL SQL Tags provide support for interaction with relational databases such as Oracle, MySQL etc. Using SQL tags we can run database queries, we include it in JSP with below syntax • <%@ taglib uri="http://java.sun.com/jsp/jstl/sq l" prefix="sql" %> 8J S T L
  • 9. JSTL XML • XML tags are used to work with XML documents such as parsing XML, transforming XML data and XPath expressions evaluation. Syntax to include XML tags in JSP page • <%@ taglib uri="http://java.sun.com/jsp/jstl/xm l" prefix="x" %> 9J S T L
  • 10. JSTL Functions • JSTL tags provide a number of functions that we can use to perform common operation, most of them are for String manipulation such as String Concatenation, Split String etc. Syntax to include JSTL functions in JSP page • <%@ taglib uri="http://java.sun.com/jsp/jstl/fu nctions" prefix="fn" %> 10J S T L
  • 11. Library URI Prefix Core http://java.sun.com/jsp/jstl/core c XML Processing http://java.sun.com/jsp/jstl/xml x Formatting http://java.sun.com/jsp/jstl/fmt fmt Database Access http://java.sun.com/jsp/jstl/sql sql Functions http://java.sun.com/jsp/jstl/functions fn JSTL URIs and Default Prefixes 11J S T L
  • 12. JSTL Core Tags Tags Description <c:out> To write something in JSP page, we can use EL also with this tag <c:import> Same as <jsp:include> or include directive <c:redirect> redirect request to another resource <c:set> To set the variable value in given scope. <c:remove> To remove the variable from given scope <c:catch> To catch the exception and wrap it into an object. <c:if> Simple conditional logic, used with EL and we can use it to process the exception from <c:catch> <c:choose> Simple conditional tag that establishes a context for mutually exclusive conditional operations, marked by <c:when> and <c:otherwise> 12J S T L
  • 13. Core Tags Library Tag Descriptor <c:when> Sub tags of <c:choose> that includes its body if its condition evaluates to ‘true’. <c:otherwise> Sub tags of <c:choose> that includes its body if its condition evaluates to ‘false’. <c:forEach> for iteration over a collection <c:forTokens> for iteration over tokens separated by a delimiter. <c:param> used with <c:import> to pass parameters <c:url> to create a URL with optional query string parameters 13J S T L
  • 14. Format Tags Tags Description <fmt:formatNumber> To render numerical value with specific precision or format. <fmt:parseNumber> Parses the string representation of a number, currency, or percentage. <fmt:formatDate> Formats a date and/or time using the supplied styles and pattern <fmt:parseDate> Parses the string representation of a date and/or time <fmt:bundle> Loads a resource bundle to be used by its tag body. <fmt:setLocale> Stores the given locale in the locale configuration variable. 14J S T L
  • 15. Format Tags Tags Description <fmt:setBundle> Loads a resource bundle and stores it in the named scoped variable or the bundle configuration variable. <fmt:timeZone> Specifies the time zone for any time formatting or parsing actions nested in its body. <fmt:setTimeZone> Stores the given time zone in the time zone configuration variable <fmt:message> To display an internationalized message. <fmt:requestEncodin g> Sets the request character encoding 15J S T L
  • 16. SQL Tags Tags Description <sql:setDataSource> Creates a simple DataSource suitable only for prototyping <sql:query> Executes the SQL query defined in its body or through the sql attribute. <sql:update> Executes the SQL update defined in its body or through the sql attribute. <sql:param> Sets a parameter in an SQL statement to the specified value. <sql:dateParam> Sets a parameter in an SQL statement to the specified java.util.Date value. <sql:transaction > Provides nested database action elements with a shared Connection, set up to execute all statements as one transaction. 16J S T L
  • 17. XML tags Tags Description <x:parse> Use to parse XML data specified either via an attribute or in the tag body. <x:set > Sets a variable to the value of an XPath expression. <x:if > Evaluates a test XPath expression and if it is true, it processes its body. If the test condition is false, the body is ignored. <x:forEach> To loop over nodes in an XML document. <x:choose> Simple conditional tag that establishes a context for mutually exclusive conditional operations, marked by <when> and <otherwise> <x:when > Subtag of <choose> that includes its body if its expression evalutes to 'true' 17J S T L
  • 18. XML Tags Tag Descriptor <x:otherwise > Subtag of <choose> that follows <when> tags and runs only if all of the prior conditions evaluated to 'false' <x:transform > Applies an XSL transformation on a XML document <x:param > Use along with the transform tag to set a parameter in the XSLT stylesheet 18J S T L
  • 19. Functions Function Description fn:contains() Tests if an input string contains the specified substring. fn:containsIgnoreCase() Tests if an input string contains the specified substring in a case insensitive way. fn:endsWith() Tests if an input string ends with the specified suffix. fn:escapeXml() Escapes characters that could be interpreted as XML markup. fn:indexOf() Returns the index withing a string of the first occurrence of a specified substring. fn:join() Joins all elements of an array into a string. 19J S T L
  • 20. Function Description fn:replace() Returns a string resulting from replacing in an input string all occurrences with a given string. fn:split() Splits a string into an array of substrings. fn:startsWith() Tests if an input string starts with the specified prefix. fn:substring() Returns a subset of a string. fn:substringAfter() Returns a subset of a string following a specific substring. fn:substringBefore() Returns a subset of a string before a specific substring. 20J S T L
  • 21. Tags Description fn:toLowerCase() Converts all of the characters of a string to lower case. fn:toUpperCase() Converts all of the characters of a string to upper case. fn:trim() Removes white spaces from both ends of a string. 21J S T L
  • 22. J S T L 22