SlideShare une entreprise Scribd logo
1  sur  21
JSP Custom Tags Svetlin Nakov National Academy for Software Development academy.devbg.org Creating and Using Custom Tags
Contents ,[object Object],[object Object],[object Object],[object Object],[object Object]
Tag Files ,[object Object],[object Object],[object Object],[object Object],[object Object],<books4u:shoppingCart currency=&quot;EUR&quot; />
Types of Tag Files ,[object Object],[object Object],[object Object],[object Object],<abc:xyz /> <abc:yyz>This is some text</abc:yyz>
Stand-Alone Tags ,[object Object],[object Object],[object Object],[object Object],<fmt:formatNumber … /> <books4u:ShoppingCart … />
Containing Tags ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A Simple Tag Example ,[object Object],[object Object],[object Object],<%@ tag body-content=&quot;empty&quot; %> <h1>Hello, world!</h1> <%@ taglib prefix=&quot;my&quot; tagdir=&quot;/WEB-INF/tags&quot; %> <my:hello />
Hello Tag Live Demo
Attributes in Tags <%@ tag body-content=&quot;empty&quot; %> <%@ attribute name=&quot;min&quot; required=&quot;false&quot; %>  <%@ attribute name=&quot;max&quot; required=&quot;false&quot; %>  <% double dMin = 0.0; if (min != null) { dMin = Double.parseDouble(min); } double dMax = 1.0; if (max != null) { dMax = Double.parseDouble(max); } double number =  (Math.random()*(dMax-dMin)) + dMin; %> <%= number %>
Random Tag Live Demo
JSTL in Tags <%@ tag body-content=&quot;empty&quot; %> <%@ attribute name=&quot;firstName&quot; required=&quot;false&quot; %>  <%@ taglib prefix=&quot;c“ uri=&quot;http://java.sun.com/jsp/jstl/core&quot; %> <c:if test='${empty firstName}'> <h1>Hello,  guest !</h1> </c:if> <c:if test='${not empty firstName}'> <h1>Hello, <c:out value='${firstName}' />!</h1> </c:if>
Body Content in Tags ,[object Object],[object Object],<%@ taglib prefix=&quot;c&quot; uri=&quot;http://java.sun.com/jsp/jstl/core&quot; %> <%@ attribute name=&quot;count&quot; required=&quot;true&quot; %> <c:forEach begin=&quot;1&quot; end=&quot;${count}&quot;> <jsp:doBody /> </c:forEach>
A Test JSP <%-- Include all tags from /WEB-INF/tags --%> <%@ taglib prefix=&quot;my&quot; tagdir=&quot;/WEB-INF/tags&quot; %> <html> <body> <%-- Use the tag &quot;repeat.tag&quot; --%> <my:repeat count=&quot;10&quot;> <div>Hello!</div> </my:repeat> </body> </html>
Repeat Tag Live Demo
Exporting Variables from Tags ,[object Object],<%@ tag body-content=&quot;scriptless&quot; %> <%@ attribute name=&quot;numTimes&quot; required=&quot;true&quot; %> <%@ attribute name=&quot;var&quot; rtexprvalue=&quot;false&quot; required=&quot;true&quot; %> <%@ variable name-from-attribute=&quot;var&quot; alias=&quot;i&quot; scope=&quot;NESTED&quot; %> <%@ taglib prefix=&quot;c&quot; uri=&quot;http://java.sun.com/jstl/core&quot; %> <c:forEach begin='1' end='${numTimes}' var='i'> <jsp:doBody /> </c:forEach>
A Test JSP <%@ taglib prefix=&quot;tag_examples&quot; tagdir=&quot;/WEB-INF/tags&quot; %> <%@ taglib prefix=&quot;c&quot; uri=&quot;http://java.sun.com/jstl/core&quot; %> <html> <body> <tag_examples:repeat_var var='index' numTimes= '5' > <div>Hello #<c:out value='${index}' />!</div> </tag_examples:repeat_var> </body> </html>
Modifying Body Content in Tags ,[object Object],<%@ tag body-content=&quot;scriptless&quot; %> <%@ taglib prefix=&quot;c&quot; uri=&quot;http://java.sun.com/jstl/core&quot; %> <jsp:doBody var='body' /> <c:forTokens var='token' items='${body}' delims=' '> <div><c:out value='${token}' /></div> </c:forTokens>
A Test JSP <%@ taglib prefix=&quot;tag_examples&quot; tagdir=&quot;/WEB-INF/tags&quot; %> <%@ taglib prefix=&quot;c&quot; uri=&quot;http://java.sun.com/jstl/core&quot; %> <html> <body> <p> The quick brown fox jumped over the lazy dog. </p> <p> <tag_examples:tokenize> The quick brown fox jumped over the lazy dog. </tag_examples:tokenize> </p> </body> </html>
JSP Custom Tags ,[object Object]
Problems ,[object Object],[object Object],[object Object],[object Object]
Problems (2) ,[object Object],[object Object],[object Object],[object Object],[object Object]

Contenu connexe

Tendances

DIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web DesigningDIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web DesigningRasan Samarasinghe
 
Introduction to Sightly
Introduction to SightlyIntroduction to Sightly
Introduction to SightlyAnkit Gubrani
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop NotesPamela Fox
 
KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7phuphax
 
Agile Development With Hobo
Agile Development With HoboAgile Development With Hobo
Agile Development With HoboEvarist Lobo
 
Introduction to HAML
Introduction to HAMLIntroduction to HAML
Introduction to HAMLJon Dean
 
JavaScript Workshop
JavaScript WorkshopJavaScript Workshop
JavaScript WorkshopPamela Fox
 
OSS BarCamp Mumbai - JSON Presentation and Demo
OSS BarCamp Mumbai - JSON Presentation and DemoOSS BarCamp Mumbai - JSON Presentation and Demo
OSS BarCamp Mumbai - JSON Presentation and DemoKetan Khairnar
 
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM ManipulationJavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulationborkweb
 
CSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JSCSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JSRichard Homa
 

Tendances (20)

DIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web DesigningDIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web Designing
 
Java script
Java scriptJava script
Java script
 
Introduction to Sightly
Introduction to SightlyIntroduction to Sightly
Introduction to Sightly
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop Notes
 
php 1
php 1php 1
php 1
 
Xhtml 2010
Xhtml 2010Xhtml 2010
Xhtml 2010
 
KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7KMUTNB - Internet Programming 4/7
KMUTNB - Internet Programming 4/7
 
Java script
Java scriptJava script
Java script
 
Javascript
JavascriptJavascript
Javascript
 
html
htmlhtml
html
 
Agile Development With Hobo
Agile Development With HoboAgile Development With Hobo
Agile Development With Hobo
 
Introduction to HAML
Introduction to HAMLIntroduction to HAML
Introduction to HAML
 
Html5 attributes
Html5  attributesHtml5  attributes
Html5 attributes
 
Java script
Java scriptJava script
Java script
 
JavaScript Workshop
JavaScript WorkshopJavaScript Workshop
JavaScript Workshop
 
OSS BarCamp Mumbai - JSON Presentation and Demo
OSS BarCamp Mumbai - JSON Presentation and DemoOSS BarCamp Mumbai - JSON Presentation and Demo
OSS BarCamp Mumbai - JSON Presentation and Demo
 
Session 3 Java Script
Session 3 Java ScriptSession 3 Java Script
Session 3 Java Script
 
JavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM ManipulationJavaScript: Ajax & DOM Manipulation
JavaScript: Ajax & DOM Manipulation
 
CSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JSCSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JS
 
Learning jsp
Learning jspLearning jsp
Learning jsp
 

En vedette

Introduction to html
Introduction to htmlIntroduction to html
Introduction to htmlvikasgaur31
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesSimon Willison
 
State management
State managementState management
State managementteach4uin
 
Windows Presentation Foundation
Windows Presentation Foundation  Windows Presentation Foundation
Windows Presentation Foundation Deepika Chaudhary
 
WEB PAGE DESIGN USING HTML
WEB PAGE DESIGN USING HTMLWEB PAGE DESIGN USING HTML
WEB PAGE DESIGN USING HTMLSneha Mukherjee
 
Web technology practical list
Web technology practical listWeb technology practical list
Web technology practical listdesaipratu10
 
State management
State managementState management
State managementIblesoft
 
Master pages ppt
Master pages pptMaster pages ppt
Master pages pptIblesoft
 
ASP.NET State management
ASP.NET State managementASP.NET State management
ASP.NET State managementShivanand Arur
 
Master pages
Master pagesMaster pages
Master pagesteach4uin
 
State management in ASP.NET
State management in ASP.NETState management in ASP.NET
State management in ASP.NETOm Vikram Thapa
 
Java Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedJava Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedBG Java EE Course
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorialAbhi Arya
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLseleciii44
 
JSP Standard Tag Library
JSP Standard Tag LibraryJSP Standard Tag Library
JSP Standard Tag LibraryIlio Catallo
 

En vedette (20)

Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
JSP : Creating Custom Tag
JSP : Creating Custom Tag JSP : Creating Custom Tag
JSP : Creating Custom Tag
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
 
State management
State managementState management
State management
 
WCF
WCFWCF
WCF
 
ASP.NET Lecture 3
ASP.NET Lecture 3ASP.NET Lecture 3
ASP.NET Lecture 3
 
Windows Presentation Foundation
Windows Presentation Foundation  Windows Presentation Foundation
Windows Presentation Foundation
 
Master page in ASP . NET
Master page in ASP . NETMaster page in ASP . NET
Master page in ASP . NET
 
WEB PAGE DESIGN USING HTML
WEB PAGE DESIGN USING HTMLWEB PAGE DESIGN USING HTML
WEB PAGE DESIGN USING HTML
 
Web technology practical list
Web technology practical listWeb technology practical list
Web technology practical list
 
State management
State managementState management
State management
 
Rich faces
Rich facesRich faces
Rich faces
 
Master pages ppt
Master pages pptMaster pages ppt
Master pages ppt
 
ASP.NET State management
ASP.NET State managementASP.NET State management
ASP.NET State management
 
Master pages
Master pagesMaster pages
Master pages
 
State management in ASP.NET
State management in ASP.NETState management in ASP.NET
State management in ASP.NET
 
Java Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedJava Server Faces (JSF) - advanced
Java Server Faces (JSF) - advanced
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTL
 
JSP Standard Tag Library
JSP Standard Tag LibraryJSP Standard Tag Library
JSP Standard Tag Library
 

Similaire à JSP Custom Tags

We9 Struts 2.0
We9 Struts 2.0We9 Struts 2.0
We9 Struts 2.0wangjiaz
 
Haml & Sass presentation
Haml & Sass presentationHaml & Sass presentation
Haml & Sass presentationbryanbibat
 
Java Script
Java ScriptJava Script
Java Scriptsiddaram
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On RailsWen-Tien Chang
 
merb.intro
merb.intromerb.intro
merb.intropjb3
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax componentsIgnacio Coloma
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?brynary
 
JWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAXJWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAXHilary Mason
 
Flex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 FinalFlex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 Finalematrix
 
ImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlaggingImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlaggingSuite Solutions
 
Quick Referance to WML
Quick Referance to WMLQuick Referance to WML
Quick Referance to WMLNitin Saswade
 

Similaire à JSP Custom Tags (20)

We9 Struts 2.0
We9 Struts 2.0We9 Struts 2.0
We9 Struts 2.0
 
Haml & Sass presentation
Haml & Sass presentationHaml & Sass presentation
Haml & Sass presentation
 
Java Script
Java ScriptJava Script
Java Script
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On Rails
 
merb.intro
merb.intromerb.intro
merb.intro
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 
Spring 2.0
Spring 2.0Spring 2.0
Spring 2.0
 
Diva
DivaDiva
Diva
 
Spring 2.0
Spring 2.0Spring 2.0
Spring 2.0
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?
 
JWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAXJWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAX
 
Front End on Rails
Front End on RailsFront End on Rails
Front End on Rails
 
Flex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 FinalFlex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 Final
 
Html tutorial
Html tutorialHtml tutorial
Html tutorial
 
ImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlaggingImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlagging
 
Quick Referance to WML
Quick Referance to WMLQuick Referance to WML
Quick Referance to WML
 
Html
HtmlHtml
Html
 
Html
HtmlHtml
Html
 
Html
HtmlHtml
Html
 
HTML5 Web Forms
HTML5 Web FormsHTML5 Web Forms
HTML5 Web Forms
 

Plus de BG Java EE Course (20)

Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
 
JSTL
JSTLJSTL
JSTL
 
Unified Expression Language
Unified Expression LanguageUnified Expression Language
Unified Expression Language
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
Web Applications and Deployment
Web Applications and DeploymentWeb Applications and Deployment
Web Applications and Deployment
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
CSS
CSSCSS
CSS
 
HTML: Tables and Forms
HTML: Tables and FormsHTML: Tables and Forms
HTML: Tables and Forms
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
WWW and HTTP
WWW and HTTPWWW and HTTP
WWW and HTTP
 
Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Data Access with JDBC
Data Access with JDBCData Access with JDBC
Data Access with JDBC
 
Introduction to-sql
Introduction to-sqlIntroduction to-sql
Introduction to-sql
 
Introduction to-RDBMS-systems
Introduction to-RDBMS-systemsIntroduction to-RDBMS-systems
Introduction to-RDBMS-systems
 
Basic data-structures-v.1.1
Basic data-structures-v.1.1Basic data-structures-v.1.1
Basic data-structures-v.1.1
 
Basic input-output-v.1.1
Basic input-output-v.1.1Basic input-output-v.1.1
Basic input-output-v.1.1
 
Strings v.1.1
Strings v.1.1Strings v.1.1
Strings v.1.1
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
Inheritance and Polymorphism
Inheritance and PolymorphismInheritance and Polymorphism
Inheritance and Polymorphism
 

Dernier

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Dernier (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

JSP Custom Tags

  • 1. JSP Custom Tags Svetlin Nakov National Academy for Software Development academy.devbg.org Creating and Using Custom Tags
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 9. Attributes in Tags <%@ tag body-content=&quot;empty&quot; %> <%@ attribute name=&quot;min&quot; required=&quot;false&quot; %> <%@ attribute name=&quot;max&quot; required=&quot;false&quot; %> <% double dMin = 0.0; if (min != null) { dMin = Double.parseDouble(min); } double dMax = 1.0; if (max != null) { dMax = Double.parseDouble(max); } double number = (Math.random()*(dMax-dMin)) + dMin; %> <%= number %>
  • 11. JSTL in Tags <%@ tag body-content=&quot;empty&quot; %> <%@ attribute name=&quot;firstName&quot; required=&quot;false&quot; %> <%@ taglib prefix=&quot;c“ uri=&quot;http://java.sun.com/jsp/jstl/core&quot; %> <c:if test='${empty firstName}'> <h1>Hello, guest !</h1> </c:if> <c:if test='${not empty firstName}'> <h1>Hello, <c:out value='${firstName}' />!</h1> </c:if>
  • 12.
  • 13. A Test JSP <%-- Include all tags from /WEB-INF/tags --%> <%@ taglib prefix=&quot;my&quot; tagdir=&quot;/WEB-INF/tags&quot; %> <html> <body> <%-- Use the tag &quot;repeat.tag&quot; --%> <my:repeat count=&quot;10&quot;> <div>Hello!</div> </my:repeat> </body> </html>
  • 15.
  • 16. A Test JSP <%@ taglib prefix=&quot;tag_examples&quot; tagdir=&quot;/WEB-INF/tags&quot; %> <%@ taglib prefix=&quot;c&quot; uri=&quot;http://java.sun.com/jstl/core&quot; %> <html> <body> <tag_examples:repeat_var var='index' numTimes= '5' > <div>Hello #<c:out value='${index}' />!</div> </tag_examples:repeat_var> </body> </html>
  • 17.
  • 18. A Test JSP <%@ taglib prefix=&quot;tag_examples&quot; tagdir=&quot;/WEB-INF/tags&quot; %> <%@ taglib prefix=&quot;c&quot; uri=&quot;http://java.sun.com/jstl/core&quot; %> <html> <body> <p> The quick brown fox jumped over the lazy dog. </p> <p> <tag_examples:tokenize> The quick brown fox jumped over the lazy dog. </tag_examples:tokenize> </p> </body> </html>
  • 19.
  • 20.
  • 21.

Notes de l'éditeur

  1. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  2. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  3. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  4. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  5. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  6. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  7. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  8. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  9. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  10. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  11. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  12. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  13. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  14. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  15. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  16. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  17. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##
  18. * 07/16/96 (c) 2006 National Academy for Software Development - http://academy.devbg.org* ##