August 2002
Intermediate to advanced
688 pages
23h
English
Scriptlet
Scriptlets are
used to embed scripting code fragments in a page. The content must be
a code fragment in the scripting language defined by the
page directive. Scriptlet code fragments are
combined with code for sending the template data between them to the
browser. The combination of all scriptlets in a page must form valid
scripting-language statements. All JSP implicit variables are visible
in a scripting element.
<% scripting code fragment %><jsp.scriptlet> scripting code fragment </jsp:scriptlet>None
<% java.util Date clock = new java.util.Date( ) %><% if (clock.getHours( ) < 12) { %>Good morning!<% } else if (clock.getHours( ) < 17) { %>Good day!<% } else { %>Good evening!<% }%>
Read now
Unlock full access