SlideShare a Scribd company logo
1 of 4
Download to read offline
http://www.tutorialspoint.com/jsp/jsp_standard_tag _library.htm Copyright © tutorialspoint.com
JSP - STANDARD TAG LIBRARY (JSTL) TUTORIAL
The JavaServer Pages Standard Tag Library (JSTL) is a collectionof usefulJSP tags whichencapsulates core
functionality commonto many JSP applications.
JSTL has support for common, structuraltasks suchas iterationand conditionals, tags for manipulating XML
documents, internationalizationtags, and SQL tags. It also provides a framework for integrating existing custom
tags withJSTL tags.
The JSTL tags canbe classified, according to their functions, into following JSTL tag library groups that canbe
used whencreating a JSP page:
Core Tags
Formatting tags
SQL tags
XML tags
JSTL Functions
Install JSTL Library:
If youare using Apache Tomcat container thenfollow the following two simple steps:
Download the binary distributionfromApache Standard Taglib and unpack the compressed file.
To use the Standard Taglib fromits Jakarta Taglibs distribution, simply copy the JAR files inthe
distribution's 'lib' directory to your application's webappsROOTWEB-INFlib directory.
To use any of the libraries, youmust include a <taglib> directive at the top of eachJSP that uses the library.
Core Tags:
The core group of tags are the most frequently used JSTL tags. Following is the syntax to include JSTL Core
library inyour JSP:
<%@ taglib prefix="c"
uri="http://java.sun.com/jsp/jstl/core" %>
There are following Core JSTL Tags:
Tag Description
<c:out > Like <%= ... >, but for expressions.
<c:set > Sets the result of anexpressionevaluationina 'scope'
<c:remove > Removes a scoped variable (froma particular scope, if specified).
<c:catch> Catches any Throwable that occurs inits body and optionally exposes it.
<c:if> Simple conditionaltag whichevalutes its body if the supplied conditionis
true.
<c:choose> Simple conditionaltag that establishes a context for mutually exclusive
conditionaloperations, marked by <when> and <otherwise>
<c:when> Subtag of <choose> that includes its body if its conditionevalutes to 'true'.
<c:otherwise > Subtag of <choose> that follows <when> tags and runs only if allof the prior
conditions evaluated to 'false'.
<c:import> Retrieves anabsolute or relative URL and exposes its contents to either the
page, a String in'var', or a Reader in'varReader'.
<c:forEach> The basic iterationtag, accepting many different collectiontypes and
supporting subsetting and other functionality .
<c:forTokens> Iterates over tokens, separated by the supplied delimeters.
<c:param> Adds a parameter to a containing 'import' tag's URL.
<c:redirect > Redirects to a new URL.
<c:url> Creates a URL withoptionalquery parameters
Formatting tags:
The JSTL formatting tags are used to format and display text, the date, the time, and numbers for
internationalized Web sites. Following is the syntax to include Formatting library inyour JSP:
<%@ taglib prefix="fmt"
uri="http://java.sun.com/jsp/jstl/fmt" %>
Following is the list of Formatting JSTL Tags:
Tag Description
<fmt:formatNumber> To render numericalvalue withspecific precisionor format.
<fmt:parseNumber> Parses the string representationof a number, currency, or percentage.
<fmt:formatDate> Formats a date and/or time using the supplied styles and pattern
<fmt:parseDate> Parses the string representationof a date and/or time
<fmt:bundle> Loads a resource bundle to be used by its tag body.
<fmt:setLocale> Stores the givenlocale inthe locale configurationvariable.
<fmt:setBundle> Loads a resource bundle and stores it inthe named scoped variable or the
bundle configurationvariable.
<fmt:timeZone> Specifies the time zone for any time formatting or parsing actions nested in
its body.
<fmt:setTimeZone> Stores the giventime zone inthe time zone configurationvariable
<fmt:message> To display aninternationalized message.
<fmt:requestEncoding> Sets the request character encoding
SQL tags:
The JSTL SQL tag library provides tags for interacting withrelationaldatabases (RDBMSs) suchas Oracle,
mySQL, or Microsoft SQL Server.
Following is the syntax to include JSTL SQL library inyour JSP:
<%@ taglib prefix="sql"
uri="http://java.sun.com/jsp/jstl/sql" %>
Following is the list of SQL JSTL Tags:
Tag Description
<sql:setDataSource> Creates a simple DataSource suitable only for prototyping
<sql:query> Executes the SQL query defined inits body or throughthe sqlattribute.
<sql:update> Executes the SQL update defined inits body or throughthe sqlattribute.
<sql:param> Sets a parameter inanSQL statement to the specified value.
<sql:dateParam> Sets a parameter inanSQL statement to the specified java.util.Date value.
<sql:transaction> Provides nested database actionelements witha shared Connection, set up
to execute allstatements as one transaction.
XML tags:
The JSTL XML tags provide a JSP-centric way of creating and manipulating XML documents. Following is the
syntax to include JSTL XML library inyour JSP.
The JSTL XML tag library has customtags for interacting withXML data. This includes parsing XML,
transforming XML data, and flow controlbased onXPathexpressions.
<%@ taglib prefix="x"
uri="http://java.sun.com/jsp/jstl/xml" %>
Before youproceed withthe examples, youwould need to copy following two XML and XPathrelated libraries
into your <Tomcat InstallationDirectory>lib:
XercesImpl.jar: Download it fromhttp://www.apache.org/dist/xerces/j/
xalan.jar: Download it fromhttp://xml.apache.org/xalan-j/index.html
Following is the list of XML JSTL Tags:
Tag Description
<x:out> Like <%= ... >, but for XPathexpressions.
<x:parse> Use to parse XML data specified either via anattribute or inthe tag body.
<x:set > Sets a variable to the value of anXPathexpression.
<x:if > Evaluates a test XPathexpressionand if it is true, it processes its body. If
the test conditionis false, the body is ignored.
<x:forEach> To loop over nodes inanXML document.
<x:choose> Simple conditionaltag that establishes a context for mutually exclusive
conditionaloperations, marked by <when> and <otherwise>
<x:when> Subtag of <choose> that includes its body if its expressionevalutes to 'true'
<x:otherwise > Subtag of <choose> that follows <when> tags and runs only if allof the prior
conditions evaluated to 'false'
<x:transform> Applies anXSL transformationona XML document
<x:param> Use along withthe transformtag to set a parameter inthe XSLT stylesheet
JSTL Functions:
JSTL includes a number of standard functions, most of whichare commonstring manipulationfunctions.
Following is the syntax to include JSTL Functions library inyour JSP:
<%@ taglib prefix="fn"
uri="http://java.sun.com/jsp/jstl/functions" %>
Following is the list of JSTL Functions:
Function Description
fn:contains() Tests if aninput string contains the specified substring.
fn:containsIgnoreCase() Tests if aninput string contains the specified substring ina case
insensitive way.
fn:endsWith() Tests if aninput string ends withthe 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 allelements of anarray into a string.
fn:length() Returns the number of items ina collection, or the number of characters
ina string.
fn:replace() Returns a string resulting fromreplacing inaninput string all
occurrences witha givenstring.
fn:split() Splits a string into anarray of substrings.
fn:startsWith() Tests if aninput string starts withthe 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.
fn:toLowerCase() Converts allof the characters of a string to lower case.
fn:toUpperCase() Converts allof the characters of a string to upper case.
fn:trim() Removes white spaces frombothends of a string.

More Related Content

What's hot

JDBC Basics (In 20 Minutes Flat)
JDBC Basics (In 20 Minutes Flat)JDBC Basics (In 20 Minutes Flat)
JDBC Basics (In 20 Minutes Flat)Craig Dickson
 
JSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGESJSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGESYoga Raja
 
JSP Standard Tag Library
JSP Standard Tag LibraryJSP Standard Tag Library
JSP Standard Tag LibraryIlio Catallo
 
Best Practices for Interoperable XML Databinding with JAXB
Best Practices for Interoperable XML Databinding with JAXBBest Practices for Interoperable XML Databinding with JAXB
Best Practices for Interoperable XML Databinding with JAXBMartin Grebac
 
ADO.Net Improvements in .Net 2.0
ADO.Net Improvements in .Net 2.0ADO.Net Improvements in .Net 2.0
ADO.Net Improvements in .Net 2.0David Truxall
 
Xml serialization
Xml serializationXml serialization
Xml serializationRaghu nath
 
Java Servlet
Java ServletJava Servlet
Java ServletYoga Raja
 
Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4than sare
 
Ch23 xml processing_with_java
Ch23 xml processing_with_javaCh23 xml processing_with_java
Ch23 xml processing_with_javaardnetij
 
Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)than sare
 
Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3IMC Institute
 
香港六合彩
香港六合彩香港六合彩
香港六合彩iewsxc
 
#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...탑크리에듀(구로디지털단지역3번출구 2분거리)
 

What's hot (20)

JDBC Basics (In 20 Minutes Flat)
JDBC Basics (In 20 Minutes Flat)JDBC Basics (In 20 Minutes Flat)
JDBC Basics (In 20 Minutes Flat)
 
JSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGESJSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGES
 
Mule caching strategy with redis cache
Mule caching strategy with redis cacheMule caching strategy with redis cache
Mule caching strategy with redis cache
 
JSP Standard Tag Library
JSP Standard Tag LibraryJSP Standard Tag Library
JSP Standard Tag Library
 
Best Practices for Interoperable XML Databinding with JAXB
Best Practices for Interoperable XML Databinding with JAXBBest Practices for Interoperable XML Databinding with JAXB
Best Practices for Interoperable XML Databinding with JAXB
 
ADO.Net Improvements in .Net 2.0
ADO.Net Improvements in .Net 2.0ADO.Net Improvements in .Net 2.0
ADO.Net Improvements in .Net 2.0
 
Jsp session 9
Jsp   session 9Jsp   session 9
Jsp session 9
 
Xml & Java
Xml & JavaXml & Java
Xml & Java
 
Jdbc
JdbcJdbc
Jdbc
 
Passing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flowPassing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flow
 
Xml serialization
Xml serializationXml serialization
Xml serialization
 
Java Servlet
Java ServletJava Servlet
Java Servlet
 
Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4
 
JDBC ppt
JDBC pptJDBC ppt
JDBC ppt
 
Ch23 xml processing_with_java
Ch23 xml processing_with_javaCh23 xml processing_with_java
Ch23 xml processing_with_java
 
JDBC Tutorial
JDBC TutorialJDBC Tutorial
JDBC Tutorial
 
Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)
 
Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3
 
香港六合彩
香港六合彩香港六合彩
香港六合彩
 
#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#29.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
 

Viewers also liked

Viewers also liked (9)

Retail industry in india
Retail industry in indiaRetail industry in india
Retail industry in india
 
Ac repair in delhi
Ac repair in delhiAc repair in delhi
Ac repair in delhi
 
Dm0804hulmepdf 1221532336093636-9
Dm0804hulmepdf 1221532336093636-9Dm0804hulmepdf 1221532336093636-9
Dm0804hulmepdf 1221532336093636-9
 
5 s in services
5 s in services5 s in services
5 s in services
 
Personalizace bez obalu
Personalizace bez obaluPersonalizace bez obalu
Personalizace bez obalu
 
Мастерская Ангел - Карнавальные костюмы. Каталог №35, 2014
Мастерская Ангел - Карнавальные костюмы. Каталог №35, 2014Мастерская Ангел - Карнавальные костюмы. Каталог №35, 2014
Мастерская Ангел - Карнавальные костюмы. Каталог №35, 2014
 
Facility location
Facility location Facility location
Facility location
 
Slide
SlideSlide
Slide
 
La costruzione di una rete di vendita (elementi di base)
La costruzione di una rete di vendita (elementi di base)La costruzione di una rete di vendita (elementi di base)
La costruzione di una rete di vendita (elementi di base)
 

Similar to Jsp standard tag_library

Similar to Jsp standard tag_library (20)

Session_15_JSTL.pdf
Session_15_JSTL.pdfSession_15_JSTL.pdf
Session_15_JSTL.pdf
 
Jsp tag library
Jsp tag libraryJsp tag library
Jsp tag library
 
Introduction to JSP
Introduction to JSPIntroduction to JSP
Introduction to JSP
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 8 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 8 ...Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 8 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 8 ...
 
JSTL.pptx
JSTL.pptxJSTL.pptx
JSTL.pptx
 
DataBase Connectivity
DataBase ConnectivityDataBase Connectivity
DataBase Connectivity
 
Jstl &amp; El
Jstl &amp; ElJstl &amp; El
Jstl &amp; El
 
Bt0083 server side programing 2
Bt0083 server side programing  2Bt0083 server side programing  2
Bt0083 server side programing 2
 
Jsp element
Jsp elementJsp element
Jsp element
 
Unit 4 web technology uptu
Unit 4 web technology uptuUnit 4 web technology uptu
Unit 4 web technology uptu
 
Unit 4 1 web technology uptu
Unit 4 1 web technology uptuUnit 4 1 web technology uptu
Unit 4 1 web technology uptu
 
MyBatis
MyBatisMyBatis
MyBatis
 
Jsp in Servlet by Rj
Jsp in Servlet by RjJsp in Servlet by Rj
Jsp in Servlet by Rj
 
JSP Technology II
JSP Technology IIJSP Technology II
JSP Technology II
 
Jstl 8
Jstl 8Jstl 8
Jstl 8
 
Chap4 4 2
Chap4 4 2Chap4 4 2
Chap4 4 2
 
Lecture 5 JSTL, custom tags, maven
Lecture 5   JSTL, custom tags, mavenLecture 5   JSTL, custom tags, maven
Lecture 5 JSTL, custom tags, maven
 
JAXB
JAXBJAXB
JAXB
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for women
 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 

Recently uploaded (20)

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

Jsp standard tag_library

  • 1. http://www.tutorialspoint.com/jsp/jsp_standard_tag _library.htm Copyright © tutorialspoint.com JSP - STANDARD TAG LIBRARY (JSTL) TUTORIAL The JavaServer Pages Standard Tag Library (JSTL) is a collectionof usefulJSP tags whichencapsulates core functionality commonto many JSP applications. JSTL has support for common, structuraltasks suchas iterationand conditionals, tags for manipulating XML documents, internationalizationtags, and SQL tags. It also provides a framework for integrating existing custom tags withJSTL tags. The JSTL tags canbe classified, according to their functions, into following JSTL tag library groups that canbe used whencreating a JSP page: Core Tags Formatting tags SQL tags XML tags JSTL Functions Install JSTL Library: If youare using Apache Tomcat container thenfollow the following two simple steps: Download the binary distributionfromApache Standard Taglib and unpack the compressed file. To use the Standard Taglib fromits Jakarta Taglibs distribution, simply copy the JAR files inthe distribution's 'lib' directory to your application's webappsROOTWEB-INFlib directory. To use any of the libraries, youmust include a <taglib> directive at the top of eachJSP that uses the library. Core Tags: The core group of tags are the most frequently used JSTL tags. Following is the syntax to include JSTL Core library inyour JSP: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> There are following Core JSTL Tags: Tag Description <c:out > Like <%= ... >, but for expressions. <c:set > Sets the result of anexpressionevaluationina 'scope' <c:remove > Removes a scoped variable (froma particular scope, if specified). <c:catch> Catches any Throwable that occurs inits body and optionally exposes it. <c:if> Simple conditionaltag whichevalutes its body if the supplied conditionis true. <c:choose> Simple conditionaltag that establishes a context for mutually exclusive conditionaloperations, marked by <when> and <otherwise> <c:when> Subtag of <choose> that includes its body if its conditionevalutes to 'true'.
  • 2. <c:otherwise > Subtag of <choose> that follows <when> tags and runs only if allof the prior conditions evaluated to 'false'. <c:import> Retrieves anabsolute or relative URL and exposes its contents to either the page, a String in'var', or a Reader in'varReader'. <c:forEach> The basic iterationtag, accepting many different collectiontypes and supporting subsetting and other functionality . <c:forTokens> Iterates over tokens, separated by the supplied delimeters. <c:param> Adds a parameter to a containing 'import' tag's URL. <c:redirect > Redirects to a new URL. <c:url> Creates a URL withoptionalquery parameters Formatting tags: The JSTL formatting tags are used to format and display text, the date, the time, and numbers for internationalized Web sites. Following is the syntax to include Formatting library inyour JSP: <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> Following is the list of Formatting JSTL Tags: Tag Description <fmt:formatNumber> To render numericalvalue withspecific precisionor format. <fmt:parseNumber> Parses the string representationof a number, currency, or percentage. <fmt:formatDate> Formats a date and/or time using the supplied styles and pattern <fmt:parseDate> Parses the string representationof a date and/or time <fmt:bundle> Loads a resource bundle to be used by its tag body. <fmt:setLocale> Stores the givenlocale inthe locale configurationvariable. <fmt:setBundle> Loads a resource bundle and stores it inthe named scoped variable or the bundle configurationvariable. <fmt:timeZone> Specifies the time zone for any time formatting or parsing actions nested in its body. <fmt:setTimeZone> Stores the giventime zone inthe time zone configurationvariable <fmt:message> To display aninternationalized message. <fmt:requestEncoding> Sets the request character encoding SQL tags: The JSTL SQL tag library provides tags for interacting withrelationaldatabases (RDBMSs) suchas Oracle, mySQL, or Microsoft SQL Server. Following is the syntax to include JSTL SQL library inyour JSP:
  • 3. <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %> Following is the list of SQL JSTL Tags: Tag Description <sql:setDataSource> Creates a simple DataSource suitable only for prototyping <sql:query> Executes the SQL query defined inits body or throughthe sqlattribute. <sql:update> Executes the SQL update defined inits body or throughthe sqlattribute. <sql:param> Sets a parameter inanSQL statement to the specified value. <sql:dateParam> Sets a parameter inanSQL statement to the specified java.util.Date value. <sql:transaction> Provides nested database actionelements witha shared Connection, set up to execute allstatements as one transaction. XML tags: The JSTL XML tags provide a JSP-centric way of creating and manipulating XML documents. Following is the syntax to include JSTL XML library inyour JSP. The JSTL XML tag library has customtags for interacting withXML data. This includes parsing XML, transforming XML data, and flow controlbased onXPathexpressions. <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %> Before youproceed withthe examples, youwould need to copy following two XML and XPathrelated libraries into your <Tomcat InstallationDirectory>lib: XercesImpl.jar: Download it fromhttp://www.apache.org/dist/xerces/j/ xalan.jar: Download it fromhttp://xml.apache.org/xalan-j/index.html Following is the list of XML JSTL Tags: Tag Description <x:out> Like <%= ... >, but for XPathexpressions. <x:parse> Use to parse XML data specified either via anattribute or inthe tag body. <x:set > Sets a variable to the value of anXPathexpression. <x:if > Evaluates a test XPathexpressionand if it is true, it processes its body. If the test conditionis false, the body is ignored. <x:forEach> To loop over nodes inanXML document. <x:choose> Simple conditionaltag that establishes a context for mutually exclusive conditionaloperations, marked by <when> and <otherwise> <x:when> Subtag of <choose> that includes its body if its expressionevalutes to 'true' <x:otherwise > Subtag of <choose> that follows <when> tags and runs only if allof the prior conditions evaluated to 'false'
  • 4. <x:transform> Applies anXSL transformationona XML document <x:param> Use along withthe transformtag to set a parameter inthe XSLT stylesheet JSTL Functions: JSTL includes a number of standard functions, most of whichare commonstring manipulationfunctions. Following is the syntax to include JSTL Functions library inyour JSP: <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> Following is the list of JSTL Functions: Function Description fn:contains() Tests if aninput string contains the specified substring. fn:containsIgnoreCase() Tests if aninput string contains the specified substring ina case insensitive way. fn:endsWith() Tests if aninput string ends withthe 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 allelements of anarray into a string. fn:length() Returns the number of items ina collection, or the number of characters ina string. fn:replace() Returns a string resulting fromreplacing inaninput string all occurrences witha givenstring. fn:split() Splits a string into anarray of substrings. fn:startsWith() Tests if aninput string starts withthe 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. fn:toLowerCase() Converts allof the characters of a string to lower case. fn:toUpperCase() Converts allof the characters of a string to upper case. fn:trim() Removes white spaces frombothends of a string.