This document provides an overview of Expression Language (EL), JSTL (JSP Standard Tag Library) 1.1, and custom tags. It describes EL expressions, implicit objects, and attributes. It explains core JSTL tags for looping, conditionals, and URL manipulation. It also discusses using JSTL tags to connect to a database and format output. Finally, it outlines how to create a custom tag library with a TLD file, tag handler class, and JSP file to implement a simple tag.
Java EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdf
This Tutorial by Simplilearn is based on Kotlin . This Tutorial is curated by industry experts based on the current IT standards and organized in the learning order. This Kotlin tutorial will help you with the fundamentals of kotlin programming language and also Android development with kotlin. This kotlin tutorial will guide you with critical skills, tips, and tricks required to be an expert in kotlin programming language.
Java DataBase Connectivity API (JDBC API)Luzan Baral
JDBC is a Java-based data access technology (Java Standard Edition platform) from Oracle Corporation. This technology is an API for the Java programming language that defines how a client may access a database. It provides methods for querying and updating data in a database. JDBC is oriented towards relational databases. A JDBC-to-ODBC bridge enables connections to any ODBC-accessible data source in the JVM host environment.
2016 is going to be the year of Virtual DOM. React.js one of the most popular implementation of Virtual DOM. But this time we won't focus on React.js. We will be focusing on what is the concept of Virtual DOM, what's the benefits, and how to use it without React.js. All of those concepts will help you understand this newest DOM manipulation technique and better work with any Virtual DOM implementations such React.js.
Java EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdfJava EE _ JSTL (1).pdf
This Tutorial by Simplilearn is based on Kotlin . This Tutorial is curated by industry experts based on the current IT standards and organized in the learning order. This Kotlin tutorial will help you with the fundamentals of kotlin programming language and also Android development with kotlin. This kotlin tutorial will guide you with critical skills, tips, and tricks required to be an expert in kotlin programming language.
Java DataBase Connectivity API (JDBC API)Luzan Baral
JDBC is a Java-based data access technology (Java Standard Edition platform) from Oracle Corporation. This technology is an API for the Java programming language that defines how a client may access a database. It provides methods for querying and updating data in a database. JDBC is oriented towards relational databases. A JDBC-to-ODBC bridge enables connections to any ODBC-accessible data source in the JVM host environment.
2016 is going to be the year of Virtual DOM. React.js one of the most popular implementation of Virtual DOM. But this time we won't focus on React.js. We will be focusing on what is the concept of Virtual DOM, what's the benefits, and how to use it without React.js. All of those concepts will help you understand this newest DOM manipulation technique and better work with any Virtual DOM implementations such React.js.
Les slides de ma présentation à Devoxx France 2017.
Introduite en Java 8, l'API Collector vit dans l'ombre de l'API Stream, ce qui est logique puisqu'un collecteur doit se connecter à un stream pour fonctionner. Le JDK est organisé de sorte que l'on utilise surtout les collectors sur étagère : groupingBy, counting et quelques autres. Ces deux éléments masquent non seulement le modèle de traitement de données des collectors, mais aussi sa puissance et ses performances.
Ces présentation parle des collectors qui existent et qu'il faut connaître, ceux que l'on peut créer, ceux dont on se doute que l'on peut les créer une fois que l'on comprend un peu les choses, et les autres, tant les possibilités offertes par cette API sont illimitées.
Les primitives java, conditions, boucles..
Object, classes, Carcatéristiques...
Héritage et accessibilité (package, visibilité)
polymorphisme
Tableau et collections
Connexion base de données via JDBC
Formation JPA Avancé / Hibernate gratuite par Ippon 2014Ippon
Les ORM, c’est pratique. Mais cela peut rapidement devenir complexe ou subtile. JPA permet de rapidement modéliser la couche d’accès aux données avec une facilité indiscutable. Cependant, il est préférable de bien en comprendre le fonctionnement pour éviter quelques anti patterns fâcheux.
La formation JPA Avancé proposée par Ippon détaille les aspects techniques et permet d’aller plus loin dans la compréhension et la maîtrise. Enrichie par des TP très fournis lorsqu’elle est dispensée par les formateurs Ippon, elle permet d’assimiler en 3 jours les subtilités et offre les outils pour réaliser une couche d’accès aux données de qualité, performante et maintenable.
Techniques de modélisation, gestion et subtilités du cache (L1, L2), mécanismes transactionnels, langage de requêtage… Tous ces aspects et bien d’autres sont détaillés et illustrés afin de vous apporter les clefs pour vos prochains projets.
Découvrez dès aujourd’hui les slides de cette formation, mis à disposition dans le cadre de l’OpenFormation.
Spring Web MVC is the original web framework built on the Servlet API and has been included in the Spring Framework from the very beginning. The formal name, “Spring Web MVC,” comes from the name of its source module (spring-webmvc), but it is more commonly known as “Spring MVC”.
Parallel to Spring Web MVC, Spring Framework 5.0 introduced a reactive-stack web framework whose name, “Spring WebFlux,” is also based on its source module (spring-webflux). This section covers Spring Web MVC.
Les slides de ma présentation à Devoxx France 2017.
Introduite en Java 8, l'API Collector vit dans l'ombre de l'API Stream, ce qui est logique puisqu'un collecteur doit se connecter à un stream pour fonctionner. Le JDK est organisé de sorte que l'on utilise surtout les collectors sur étagère : groupingBy, counting et quelques autres. Ces deux éléments masquent non seulement le modèle de traitement de données des collectors, mais aussi sa puissance et ses performances.
Ces présentation parle des collectors qui existent et qu'il faut connaître, ceux que l'on peut créer, ceux dont on se doute que l'on peut les créer une fois que l'on comprend un peu les choses, et les autres, tant les possibilités offertes par cette API sont illimitées.
Les primitives java, conditions, boucles..
Object, classes, Carcatéristiques...
Héritage et accessibilité (package, visibilité)
polymorphisme
Tableau et collections
Connexion base de données via JDBC
Formation JPA Avancé / Hibernate gratuite par Ippon 2014Ippon
Les ORM, c’est pratique. Mais cela peut rapidement devenir complexe ou subtile. JPA permet de rapidement modéliser la couche d’accès aux données avec une facilité indiscutable. Cependant, il est préférable de bien en comprendre le fonctionnement pour éviter quelques anti patterns fâcheux.
La formation JPA Avancé proposée par Ippon détaille les aspects techniques et permet d’aller plus loin dans la compréhension et la maîtrise. Enrichie par des TP très fournis lorsqu’elle est dispensée par les formateurs Ippon, elle permet d’assimiler en 3 jours les subtilités et offre les outils pour réaliser une couche d’accès aux données de qualité, performante et maintenable.
Techniques de modélisation, gestion et subtilités du cache (L1, L2), mécanismes transactionnels, langage de requêtage… Tous ces aspects et bien d’autres sont détaillés et illustrés afin de vous apporter les clefs pour vos prochains projets.
Découvrez dès aujourd’hui les slides de cette formation, mis à disposition dans le cadre de l’OpenFormation.
Spring Web MVC is the original web framework built on the Servlet API and has been included in the Spring Framework from the very beginning. The formal name, “Spring Web MVC,” comes from the name of its source module (spring-webmvc), but it is more commonly known as “Spring MVC”.
Parallel to Spring Web MVC, Spring Framework 5.0 introduced a reactive-stack web framework whose name, “Spring WebFlux,” is also based on its source module (spring-webflux). This section covers Spring Web MVC.
Stripes presentation for the Portuguese JUG session at JavaPT09 event.
Last version available at Speaker Deck: http://speakerdeck.com/samaxes/java-web-development-with-stripes.
Session highlighting and demonstrating approaches to common challenges in modern portlet development. Topics include AJAX in JSR-168 and JSR-286 portlets, CSS and Javascript toolkits, security, and optimization of front-end resources. This session was presented at the Jasig Spring 2010 conference in San Diego, CA by Jennifer Bourey.
This was a talk given at Django District in March, 2016. It goes over the general gist of how to integrate Django Rest Framework with React and Redux. It also includes a github repo with working code, including using Webpack for Hot Reloading and Redux Dev Tools for time traveling state.
PrimeFaces, JavaServer Faces icin gelistirllen ve dunya capinda populer olan zengin bir arayuz kutuphanesidir. Bu sunumda PrimeFaces Bilesenleri, Mobil, Ajax Push, Tema Destegi gibi modullerin yani sira PrimeFaces ekibinin gelistirdigi yeni jQuery javascript kutuphanesi PrimeUI'da tanitilmaktadir.
The world of JavaScript client-side frameworks is overflowing with contenders vying for the crown, but which one do you choose for your next project? Which one has what it takes?
In this talk we’ll look at the “Big 3”, AngularJS, Ember.js, and Backbone.js. We’ll compare them head to head, toe to toe. We’ll look at the pros and cons of each one. How do they handle form bindings? Talking to APIs? Code organization? Routing? Etc?
Who’ll come out victorious in this battle of the JavaScript frameworks, or will we all just come out bloodied and bruised on the other side? Guess we’ll find out!
Backbone.js — Introduction to client-side JavaScript MVCpootsbook
Using Backbone.js to move state to the client-side and the benefits of using a JavaScript MVC framework.
Delivered at SuperMondays, Newcastle upon Tyne, on 26th September 2011.
Similar to Java Web Programming [5/9] : EL, JSTL and Custom Tags (20)
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
3. Expression Language
EL expressions are ALWAYS within curly braces,
and prefixed with the dollar sign
${firstThing.secondThing}
firstThing can be
EL Implicit Object
Attribute
3
4. EL Implicit Object and Attribute
EL Implicit Object Attribute
param in page scope
paramValues
in request scope
header in session scope
headerValues
in application scope
cookie
initParam
pageContext
pageScope
requestScope
sessionScope
applicationScope
4
5. EL Implicit Objects
Implicit Object Description
param Maps of all the form parameters that were
paramValues passed to your JSP
header Maps of all the request headers
headerValues
cookie A Map of all the cookies passed to your JSP
initParam A Map of the context init parameters
pageScope A Map of all the objects that have page,
requestScope request, session and application scope
sessionScope
applicationScope
5
13. Disable the EL
For a single page
<%@ page isELIgnored="true" %>
For an entire application
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<el-enabled>false</el-enabled>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
13
14. The taglib Directive
Tag libraries come in two different flavors:
JSTL (JavaServerPages Standard Tag Library)
Custom Tag Libraries
The syntax for the taglib directive is as follows:
<%@ taglib uri=“taglibraryURI” prefix=“tagPrefix” %>
14
24. poll.html
:
<body>
<h3>Do you agree with the opposition
to boycott the election?</h3>
<form action = "vote.jsp" method = "post">
<input type=radio name=answer value="Yes"> Yes<br>
<input type=radio name=answer value="No"> No<br>
<input type=radio name=answer value="No Comment"> No Comment<br>
<br><input type=submit value="VOTE">
</form>
</body>
:
24
25. <c:if>
<%@taglib uri="http://java.sun.com/jsp/jstl/core"
prefix="c" %>
<c:if test="${param.answer == 'Yes'}" >
You vote for Yes
</c:if>
<c:if test="${param.answer == 'No'}" >
You vote for No
</c:if>
<c:if test="${param.answer == 'No Comment'}" >
You vote for No Comment
</c:if>
25
26. <c:choose>, <c:when> and
<c:otherwise>
<%@taglib uri="http://java.sun.com/jsp/jstl/core"
prefix="c" %>
<c:choose>
<c:when test="${param.field == 'Network'}" >
You choose Network
</c:when>
<c:when test="${param.field == 'Database'}" >
You choose Database
</c:when>
<c:otherwise>
You choose Programming
</c:otherwise>
</c:choose>
26
29. <c:set> and <c:remove>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="status" scope="request" value="On-line" />
Status is ${status} <br>
<c:remove var="status" scope="request" />
Now, status is ${status}
29
30. <c:catch>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
About to do a risky thing <br>
<c:catch var="myException" >
<% int x = 10/0; %>
</c:catch>
<c:if test="${myException != null}">
There was an exception: ${myException.message} <br>
</c:if>
If you see this, we survived.
30
32. <c:import>
<%-- Header2.jsp --%>
Information Technology KMITL
-----------------------------------------------------------------
<%-- Test2.jsp --%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:import url="http://localhost:8084/SWP_Topic5/Header2.jsp" />
-----------------------------------------------------------------
The <c:import> action can also
be used to specify absolute,
relative and FTP URL resources
to provide a lot more functionality
than the standard <jsp:include> action.
<c:import> can reach OUTSIDE the
web app
32
33. <c:redirect>
<%-- Header3.jsp --%>
Information Technology KMITL
-----------------------------------------------------------------
<%-- Test3.jsp --%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:redirect url="http://localhost:8084/SWP_Topic5/Header3.jsp" />
-----------------------------------------------------------------
The <c:redirect> action simply
sends an HTTP redirect to
a client.
33
34. <c:url> and <c:param>
<%-- Header4.jsp --%>
${param.faculty}
-----------------------------------------------------------------
<%-- Test4.jsp --%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:url value="http://localhost:8084/SWP_Topic5/Header4.jsp " >
<c:param name="faculty" value="Information Technology" />
</c:url>
-----------------------------------------------------------------
The <c:url> action takes care of the encoding and all the URL rewriting.
http://localhost:8084/JSP2/Header.jsp;jsessionid=543ferew432esd23
34
35. SQL Tag Library
<sql:setDataSource>
<sql:query>
<sql:update>
<sql:param> and <sql:dateParam>
<sql:transaction>
35
36. BookStore.jsp
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<html>
<head><title>ABC Book Store </title></head>
<body>
<center>
<form action="BookStore.jsp">
<h1> ABC Book Store </h1>
<br> Please select a Book and add it to your shopping cart
</p>
<sql:setDataSource var="datasource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql:///test" user="root"
password="root" />
<sql:query var="books" dataSource="${datasource}" >
select * from books
</sql:query>
36
39. Custom Tag Libraries
The JSP 1.1 specifications introduced the
ability to define new tags called custom tags
Can be used in any number of JSP files
A user can define how the tag, its attributes
and its body are to be interpreted, and then
group these tags into collections, called tag
libraries.
39
40. Simple Tag Files
1. Take an included file (such as “Header.jsp”) and rename it
with a .tag extension
<%-- Header.jsp --%>
<img src="Duke_Cont.png"><br><br>
Welcome to Java World!!
1. Put the tag file (such as “Header.tag”) in a directory named
“tags” inside the “WEB-INF” directory
1. Put a taglib directive (with a tagdir atttribute) in the JSP
(TestTag.jsp)
<%@taglib tagdir="/WEB-INF/tags" prefix="myTags" %>
<myTags:Header/>
40
42. Components that make up a Tag library
1. The Tag Library Descriptor (TLD) file
2. The Tag Handler class
Classic
Simple
1. The JSP file
42
43. Repeat Tag Implemented as a
Classic JSP 1.2 Tag Extension
<%@ taglib prefix="my"
uri="/mytags" %>
<my:repeat num="3">
Usage
tag body
</my:repeat>
int doStartTag() {
this.count = this.num;
Implementation
return Tag.EVAL_BODY_INCLUDE;
}
int doAfterBody() {
this.count--;
return (this.count > 0) ?
Tag.EVAL_BODY_AGAIN :
Tag.SKIP_BODY; 43
}
44. Repeat Tag Implemented as a
Simple JSP 2.0 Tag Extension
<%@ taglib prefix="my"
uri="/mytags" %>
Usage
<my:repeat num="3">
tag body
</my:repeat>
void doTag() {
Implementation
for( int i = 0; i < num; i++ ) {
getJspBody().invoke( null );
}
}
44
47. JSP File
Import the tag library
Specify location of TLD file and define a tag
prefix (namespace)
<%@ taglib uri="myTaglib" prefix="myPrefix" %>
Use the tags
<prefix:tagName />
Prefix comes from taglib directive
Tag name comes from tag added into TLD file
Example <myPrefix:myTag />
47
48. Write a JSP that uses the tag
<%-- UseCustomTag.jsp --%>
<%@taglib uri="TestMyTag1" prefix="my" %>
<my:test1/>
48
49. Thank you
thananum@gmail.com
www.facebook.com/imcinstitute
www.imcinstitute.com
49