SlideShare a Scribd company logo
SESSION – 10
By→ Anuj Kumar Singh
JSTL Core <c:if> Tag
1. The < c:if > tag is used for testing the condition and it display the body
content, if the expression evaluated is true.
2. It is a simple conditional tag which is used for evaluating the body
content, if the supplied condition is true.
Example
a. newjsp.jsp
Output
JSTL Core <c:choose>, <c:when>, <c:otherwise> Tag
1. The < c:choose > tag is a conditional tag that establish a context for
mutually exclusive conditional operations. It works like a
Java switch statement in which we choose between a numbers of
alternatives.
2. The <c:when > is subtag of <choose > that will include its body if the
condition evaluated be 'true'.
3. The < c:otherwise > is also subtag of < choose > it follows <when >
tags and runs only if all the prior condition evaluated is 'false'.
Example 1:
a. newjsp.jsp
Output
Example 2:
a. newjsp.jsp
Output
JSTL Core <c:forEach> Tag
1. The <c:for each > is an iteration tag used for repeating the nested
body content for fixed number of times or over the collection.
2. These tag used as a good alternative for embedding a Java while,
do-while, or for loop via a scriptlet. The < c:for each > tag is most
commonly used tag because it iterates over a collection of object.
Example
a. newjsp.jsp
Output
JSTL Core <c:forTokens> Tag
1. The < c:forTokens > tag iterates over tokens which is separated by
the supplied delimeters. It is used for break a string into tokens and
iterate through each of the tokens to generate output.
2. This tag has similar attributes as < c:forEach > tag except one
additional attributes delims which is used for specifying the
characters to be used as delimiters.
Example
a. newjsp.jsp
Output
JSTL Core <c:param> Tag
1. The < c:param > tag add the parameter in a containing 'import' tag's
URL. It allow the proper URL request parameter to be specified within
URL and it automatically perform any necessary URL encoding.
2. Inside < c:param > tag, the value attribute indicates the parameter
value and name attribute indicates the parameter name.
Example
a. newjsp.jsp
Output
JSTL Core <c:redirect> Tag
1. The < c:redirect > tag redirects the browser to a new URL. It
supports the context-relative URLs, and the < c:param > tag.
2. It is used for redirecting the browser to an alternate URL by using
automatic URL rewriting.
Example
a. newjsp.jsp
Value is set to 0
so url depends
on the condition
before redirecting
JSTL Core <c:url> Tag
1. The < c:url > tag creates a URL with optional query parameter. It is
used for url encoding or url formatting. This tag automatically
performs the URL rewriting operation.
2. The JSTL url tag is used as an alternative method of writing call to
the response.encodeURL() method. The advantage of url tag is
proper URL encoding and including the parameters specified by
children. param tag.
Example
a. newjsp.jsp
Output
Jsp   session 10

More Related Content

What's hot

Javascript: master this
Javascript: master thisJavascript: master this
Javascript: master this
Barak Drechsler
 
Struts2.0basic
Struts2.0basicStruts2.0basic
Struts2.0basic
­Avishek A
 
Writing Test Cases with PHPUnit
Writing Test Cases with PHPUnitWriting Test Cases with PHPUnit
Writing Test Cases with PHPUnit
Shouvik Chatterjee
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
nanjil1984
 
Jsp intro
Jsp introJsp intro
Jsp intro
husnara mohammad
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
DivyaKS12
 
Javascript conditional statements 1
Javascript conditional statements 1Javascript conditional statements 1
Javascript conditional statements 1
Jesus Obenita Jr.
 
React Hooks
React HooksReact Hooks
React Hooks
Erez Cohen
 
Java Unit Test - JUnit
Java Unit Test - JUnitJava Unit Test - JUnit
Java Unit Test - JUnit
Aktuğ Urun
 
Introduction to mysql part 3
Introduction to mysql part 3Introduction to mysql part 3
React js t2 - jsx
React js   t2 - jsxReact js   t2 - jsx
React js t2 - jsx
Jainul Musani
 
React hooks
React hooksReact hooks
React hooks
Sadhna Rana
 
Effective Unit Test Style Guide
Effective Unit Test Style GuideEffective Unit Test Style Guide
Effective Unit Test Style Guide
Jacky Lai
 
Demanding scripting
Demanding scriptingDemanding scripting
Demanding scripting
Pauli Wahlberg
 
Unit testing with Easymock
Unit testing with EasymockUnit testing with Easymock
Unit testing with Easymock
Ürgo Ringo
 
jasmine
jasminejasmine
Testing And Mxunit In ColdFusion
Testing And Mxunit In ColdFusionTesting And Mxunit In ColdFusion
Testing And Mxunit In ColdFusion
Denard Springle IV
 
All about unit testing using (power) mock
All about unit testing using (power) mockAll about unit testing using (power) mock
All about unit testing using (power) mock
Pranalee Rokde
 
Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()
Umar Ali
 
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
 

What's hot (20)

Javascript: master this
Javascript: master thisJavascript: master this
Javascript: master this
 
Struts2.0basic
Struts2.0basicStruts2.0basic
Struts2.0basic
 
Writing Test Cases with PHPUnit
Writing Test Cases with PHPUnitWriting Test Cases with PHPUnit
Writing Test Cases with PHPUnit
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
 
Jsp intro
Jsp introJsp intro
Jsp intro
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
 
Javascript conditional statements 1
Javascript conditional statements 1Javascript conditional statements 1
Javascript conditional statements 1
 
React Hooks
React HooksReact Hooks
React Hooks
 
Java Unit Test - JUnit
Java Unit Test - JUnitJava Unit Test - JUnit
Java Unit Test - JUnit
 
Introduction to mysql part 3
Introduction to mysql part 3Introduction to mysql part 3
Introduction to mysql part 3
 
React js t2 - jsx
React js   t2 - jsxReact js   t2 - jsx
React js t2 - jsx
 
React hooks
React hooksReact hooks
React hooks
 
Effective Unit Test Style Guide
Effective Unit Test Style GuideEffective Unit Test Style Guide
Effective Unit Test Style Guide
 
Demanding scripting
Demanding scriptingDemanding scripting
Demanding scripting
 
Unit testing with Easymock
Unit testing with EasymockUnit testing with Easymock
Unit testing with Easymock
 
jasmine
jasminejasmine
jasmine
 
Testing And Mxunit In ColdFusion
Testing And Mxunit In ColdFusionTesting And Mxunit In ColdFusion
Testing And Mxunit In ColdFusion
 
All about unit testing using (power) mock
All about unit testing using (power) mockAll about unit testing using (power) mock
All about unit testing using (power) mock
 
Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()
 
JDBC Basics (In 20 Minutes Flat)
JDBC Basics (In 20 Minutes Flat)JDBC Basics (In 20 Minutes Flat)
JDBC Basics (In 20 Minutes Flat)
 

Similar to Jsp session 10

Session_15_JSTL.pdf
Session_15_JSTL.pdfSession_15_JSTL.pdf
Session_15_JSTL.pdf
TabassumMaktum
 
Jsp standard tag_library
Jsp standard tag_libraryJsp standard tag_library
Jsp standard tag_library
KP Singh
 
JSTL.pptx
JSTL.pptxJSTL.pptx
JSTL.pptx
SPAMVEDANT
 
Jsp tag library
Jsp tag libraryJsp tag library
Jsp tag library
sandeep54552
 
Bt0083 server side programing 2
Bt0083 server side programing  2Bt0083 server side programing  2
Bt0083 server side programing 2
Techglyphs
 
Jstl 8
Jstl 8Jstl 8
JSP Standard Tag Library
JSP Standard Tag LibraryJSP Standard Tag Library
JSP Standard Tag Library
VISHAL DONGA
 
Implementing java server pages standard tag library v2
Implementing java server pages standard tag library v2Implementing java server pages standard tag library v2
Implementing java server pages standard tag library v2
Soujanya V
 
Introduction to JSP
Introduction to JSPIntroduction to JSP
Introduction to JSP
Geethu Mohan
 
Ejb5
Ejb5Ejb5
Struts 2
Struts 2Struts 2
Struts 2
Lalit Garg
 
Types of Dependency Injection in Spring
Types of Dependency Injection in SpringTypes of Dependency Injection in Spring
Types of Dependency Injection in Spring
Sunil kumar Mohanty
 
Jsp session 2
Jsp   session 2Jsp   session 2
Jsp session 2
Anuj Singh Rajput
 
Jsp and jstl
Jsp and jstlJsp and jstl
Jsp and jstl
vishal choudhary
 
JSP Technology II
JSP Technology IIJSP Technology II
JSP Technology II
People Strategists
 
JPA 2.0
JPA 2.0JPA 2.0
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
Information Technology
 
Jsp element
Jsp elementJsp element
Jsp element
kamal kotecha
 
SoftTest Ireland: Model Based Testing - January 27th 2011
SoftTest Ireland: Model Based Testing - January 27th 2011SoftTest Ireland: Model Based Testing - January 27th 2011
SoftTest Ireland: Model Based Testing - January 27th 2011
David O'Dowd
 
Krazykoder struts2 interceptors
Krazykoder struts2 interceptorsKrazykoder struts2 interceptors
Krazykoder struts2 interceptors
Krazy Koder
 

Similar to Jsp session 10 (20)

Session_15_JSTL.pdf
Session_15_JSTL.pdfSession_15_JSTL.pdf
Session_15_JSTL.pdf
 
Jsp standard tag_library
Jsp standard tag_libraryJsp standard tag_library
Jsp standard tag_library
 
JSTL.pptx
JSTL.pptxJSTL.pptx
JSTL.pptx
 
Jsp tag library
Jsp tag libraryJsp tag library
Jsp tag library
 
Bt0083 server side programing 2
Bt0083 server side programing  2Bt0083 server side programing  2
Bt0083 server side programing 2
 
Jstl 8
Jstl 8Jstl 8
Jstl 8
 
JSP Standard Tag Library
JSP Standard Tag LibraryJSP Standard Tag Library
JSP Standard Tag Library
 
Implementing java server pages standard tag library v2
Implementing java server pages standard tag library v2Implementing java server pages standard tag library v2
Implementing java server pages standard tag library v2
 
Introduction to JSP
Introduction to JSPIntroduction to JSP
Introduction to JSP
 
Ejb5
Ejb5Ejb5
Ejb5
 
Struts 2
Struts 2Struts 2
Struts 2
 
Types of Dependency Injection in Spring
Types of Dependency Injection in SpringTypes of Dependency Injection in Spring
Types of Dependency Injection in Spring
 
Jsp session 2
Jsp   session 2Jsp   session 2
Jsp session 2
 
Jsp and jstl
Jsp and jstlJsp and jstl
Jsp and jstl
 
JSP Technology II
JSP Technology IIJSP Technology II
JSP Technology II
 
JPA 2.0
JPA 2.0JPA 2.0
JPA 2.0
 
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
Jsp element
Jsp elementJsp element
Jsp element
 
SoftTest Ireland: Model Based Testing - January 27th 2011
SoftTest Ireland: Model Based Testing - January 27th 2011SoftTest Ireland: Model Based Testing - January 27th 2011
SoftTest Ireland: Model Based Testing - January 27th 2011
 
Krazykoder struts2 interceptors
Krazykoder struts2 interceptorsKrazykoder struts2 interceptors
Krazykoder struts2 interceptors
 

More from Anuj Singh Rajput

Web technology
Web technologyWeb technology
Web technology
Anuj Singh Rajput
 
Java script
Java scriptJava script
Java script
Anuj Singh Rajput
 
Html (hypertext markup language)
Html (hypertext markup language)Html (hypertext markup language)
Html (hypertext markup language)
Anuj Singh Rajput
 
Css
CssCss
Bootstrap
BootstrapBootstrap
Jsp session 13
Jsp   session 13Jsp   session 13
Jsp session 13
Anuj Singh Rajput
 
Jsp session 12
Jsp   session 12Jsp   session 12
Jsp session 12
Anuj Singh Rajput
 
Jsp session 11
Jsp   session 11Jsp   session 11
Jsp session 11
Anuj Singh Rajput
 
Jsp session 8
Jsp   session 8Jsp   session 8
Jsp session 8
Anuj Singh Rajput
 
Jsp session 7
Jsp   session 7Jsp   session 7
Jsp session 7
Anuj Singh Rajput
 
Jsp session 6
Jsp   session 6Jsp   session 6
Jsp session 6
Anuj Singh Rajput
 
Jsp session 5
Jsp   session 5Jsp   session 5
Jsp session 5
Anuj Singh Rajput
 
Jsp session 4
Jsp   session 4Jsp   session 4
Jsp session 4
Anuj Singh Rajput
 
Jsp session 3
Jsp   session 3Jsp   session 3
Jsp session 3
Anuj Singh Rajput
 
Jsp session 1
Jsp   session 1Jsp   session 1
Jsp session 1
Anuj Singh Rajput
 
Servlet session 14
Servlet   session 14Servlet   session 14
Servlet session 14
Anuj Singh Rajput
 
Servlet session 13
Servlet   session 13Servlet   session 13
Servlet session 13
Anuj Singh Rajput
 
Servlet session 12
Servlet   session 12Servlet   session 12
Servlet session 12
Anuj Singh Rajput
 
Servlet session 11
Servlet   session 11Servlet   session 11
Servlet session 11
Anuj Singh Rajput
 
Servlet session 10
Servlet   session 10Servlet   session 10
Servlet session 10
Anuj Singh Rajput
 

More from Anuj Singh Rajput (20)

Web technology
Web technologyWeb technology
Web technology
 
Java script
Java scriptJava script
Java script
 
Html (hypertext markup language)
Html (hypertext markup language)Html (hypertext markup language)
Html (hypertext markup language)
 
Css
CssCss
Css
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
Jsp session 13
Jsp   session 13Jsp   session 13
Jsp session 13
 
Jsp session 12
Jsp   session 12Jsp   session 12
Jsp session 12
 
Jsp session 11
Jsp   session 11Jsp   session 11
Jsp session 11
 
Jsp session 8
Jsp   session 8Jsp   session 8
Jsp session 8
 
Jsp session 7
Jsp   session 7Jsp   session 7
Jsp session 7
 
Jsp session 6
Jsp   session 6Jsp   session 6
Jsp session 6
 
Jsp session 5
Jsp   session 5Jsp   session 5
Jsp session 5
 
Jsp session 4
Jsp   session 4Jsp   session 4
Jsp session 4
 
Jsp session 3
Jsp   session 3Jsp   session 3
Jsp session 3
 
Jsp session 1
Jsp   session 1Jsp   session 1
Jsp session 1
 
Servlet session 14
Servlet   session 14Servlet   session 14
Servlet session 14
 
Servlet session 13
Servlet   session 13Servlet   session 13
Servlet session 13
 
Servlet session 12
Servlet   session 12Servlet   session 12
Servlet session 12
 
Servlet session 11
Servlet   session 11Servlet   session 11
Servlet session 11
 
Servlet session 10
Servlet   session 10Servlet   session 10
Servlet session 10
 

Recently uploaded

Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
sayalidalavi006
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 

Recently uploaded (20)

Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 

Jsp session 10

  • 1. SESSION – 10 By→ Anuj Kumar Singh
  • 2. JSTL Core <c:if> Tag 1. The < c:if > tag is used for testing the condition and it display the body content, if the expression evaluated is true. 2. It is a simple conditional tag which is used for evaluating the body content, if the supplied condition is true.
  • 4. JSTL Core <c:choose>, <c:when>, <c:otherwise> Tag 1. The < c:choose > tag is a conditional tag that establish a context for mutually exclusive conditional operations. It works like a Java switch statement in which we choose between a numbers of alternatives. 2. The <c:when > is subtag of <choose > that will include its body if the condition evaluated be 'true'. 3. The < c:otherwise > is also subtag of < choose > it follows <when > tags and runs only if all the prior condition evaluated is 'false'.
  • 7. JSTL Core <c:forEach> Tag 1. The <c:for each > is an iteration tag used for repeating the nested body content for fixed number of times or over the collection. 2. These tag used as a good alternative for embedding a Java while, do-while, or for loop via a scriptlet. The < c:for each > tag is most commonly used tag because it iterates over a collection of object.
  • 9. JSTL Core <c:forTokens> Tag 1. The < c:forTokens > tag iterates over tokens which is separated by the supplied delimeters. It is used for break a string into tokens and iterate through each of the tokens to generate output. 2. This tag has similar attributes as < c:forEach > tag except one additional attributes delims which is used for specifying the characters to be used as delimiters.
  • 11. JSTL Core <c:param> Tag 1. The < c:param > tag add the parameter in a containing 'import' tag's URL. It allow the proper URL request parameter to be specified within URL and it automatically perform any necessary URL encoding. 2. Inside < c:param > tag, the value attribute indicates the parameter value and name attribute indicates the parameter name.
  • 13. JSTL Core <c:redirect> Tag 1. The < c:redirect > tag redirects the browser to a new URL. It supports the context-relative URLs, and the < c:param > tag. 2. It is used for redirecting the browser to an alternate URL by using automatic URL rewriting.
  • 14. Example a. newjsp.jsp Value is set to 0 so url depends on the condition before redirecting
  • 15. JSTL Core <c:url> Tag 1. The < c:url > tag creates a URL with optional query parameter. It is used for url encoding or url formatting. This tag automatically performs the URL rewriting operation. 2. The JSTL url tag is used as an alternative method of writing call to the response.encodeURL() method. The advantage of url tag is proper URL encoding and including the parameters specified by children. param tag.