|
|
|
|
What we've seen so far are a number of JSP expressions: <%= request.getParameter("first-name") %>
which treats the contents of the tag as a Java expression. In the servlet, the expression is evaluated, converted into a string, and output to the web page in the appropriate position. To provide more power to a JSP page, we also have JSP Scriptlets, which can contain more Java code: <!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=UTF-8">
<title>Countdown JSP Page</title>
</head>
<body>
<h1>Countdown JSP Page</h1>
<p>Counting down...</p>
<%
for (int count = 10; count > 0; count--)
{
out.print( count + " ");
}
%>
<h3 style="color: red">BOOM!</h3>
</body>
</html>
Here is what that JSP page produces:
|
| The page was last updated February 19, 2008 |