// The following demo is from
// The latest offering from Apress is Pro JSP, 3rd Edition
// Author: Brown et al.
// ISBN : 1-59059-225-5
// URL :Pro JSP, 3rd Edition
// download the jstltest.war for testing the following code.
// set
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
Your browser is :
// tokens
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
scope="request" />
First Name
Last Name
Sex
Age
Occupation
Location
// remove
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
Your browser is :
// output
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ page import="com.apress.projsp20.ch04.Book"%>
The latest offering from Apress is
Author:
ISBN :
URL :">
// choose
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ page import="com.apress.projsp20.ch04.CalendarBean"%>
The time is currently :
,
0 && hour <=11}">
Good Morning!
= 12 && hour <=17}">
Good Afternoon!
Good Evening!
// if
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ page import="com.apress.projsp20.ch04.CalendarBean"%>
The time is currently :
,
0 && hour <=11}">
Good Morning!
= 12 && hour <=17}">
Good Afternoon!
= 18 && hour <=23}">
Good Evening!
// import
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
// format
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
Wrox Survey
// format
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
Survey
// format date
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
Examples of Date & Time Formatting
Default Time Zone
Default format :
A Date only in a Custom dd/MM/yyyy format :
A Time only in MEDIUM format :
A Date and Time in FULL format :
America/Los_Angeles Time Zone
Default format :
A Date only in a Custom MM-dd-yyyy format :
A Time only in MEDIUM format :
A Date and Time in FULL format :
// format number
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
Number Format Example
Formatting 123.4 becomes :
Currency Format Example
Salary =
Formatting salary with Locale en_GB becomes :
Formatting salary with Locale it_IT becomes :
// XML transform
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
// XML set
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
// XML output
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
// XML for each
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
Another great title from Apress!
A reasonable title from Bloggs Publisher!
A title from an unknown publisher
Author :
ISBN :
Published :
URL :
'>
// XML if
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
Another great title from Apress! :