In this JavaEE JSP Tutorial, we will see how JSP web page is using our custom tag via the TagLib directive.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<!-- Sample 05: Entry for Core Tag Library --> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!-- Sample 06: Entry for our custom Tag Library --> <%@ taglib uri="http://www.tube.codingexamples.jtags" prefix="My" %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <!-- Sample 07: Entry for our custom Tag Library --> <H1>Using the custom Tag to List Book Titles</H1> <div style="font-size: large; color: red; background-color: silver"> <!-- Sample 08: JSP Programmer using Custom Tag Developed by Java Coder --> <My:ListBooks books="${BookTitles}" /> </div> </body> </html> |
Categories: JSP