Using Template Text
Besides JSP elements, notice that th
e easy.jsp page c
ie Contains mostl
ly regular HTML,
highlighted in Example 5-2,
Example 5-2. JSP page template text
cae page contentType="text/html” %>
urie"http://java.sun.com/jsp/jstl/core" %
Gap taglib prefix="c
html
chead>
“titlesISP is Easy
«body bgcolor="white">
chivJSP is as easy as -+«
&-- Calculate the sum of 1 +24
tt value="${1 + 2 + 3}" >
3 dynamically --%
44243 =
this is called template text. Everything that’s not 2 JSP element (.
Template text 5 sent tO
pased out-
Jement) is template text.
re any type of text
ntainer doesn’t care what th
In JSP parlance,
not a directive, action or scripting ¢
is, This means you can us
the browser as i
put, such as XML, ML, or even plain tex!
template text represents.
se JSP to general
t. The JSP co. ch as write to a file
xr things suc! om |
i Jso do othe is later added t
in thi ter, but it can al ase that is 9 the
ee ae or retrieve data from @ datab:
i e again, this time wi
response by other actions. Example 5-3 shows the easy-jsP PaBe 280 th
mse :
the JSP action element highlighted.
Example 5-3, JSP action elements
<#8 page contentType="text/html” % pe " %
<#@ taglib prefixe"c" uris"http://java-sun.com/jsp/jstl/core
IsP is Easy
<&- Calculate the sum of 1 +2 +3 dynamically --%
142 +3 = ccrout valuez"${a +2 +3)" /
Can action is represented by an HTMLilike element i
, na JSP 3
ment bas a body, i's represented by an opening tap neq ee™ HE the aétion &
pairs, a body, and a closing tag: 'Y with attribute/val
7 ISP is as easy as ...
<& Calculate the sum of 1 + 2 +3 dynamically --X>
14243 =
Installing a JSP Page
(i cia