Decision-Making
Statements:
Theif...else block starts out
like an ordinary scriptlet,but the scriptlet is closed at each line with HTML
text included between scriptlet tags.
<%! int day = 3; %>
<html>
<head>
<title>if...else
example</title>
</head>
<body>
<% if (day
== 1 | day == 7) { %>
<p> Today
is weekend</p>
<% } else {
%>
<p> Today
is not weekend</p>
<% } %>
</body>
</html>
You can use three basic types of
looping blocks in Java:
for, while,and do…while
blocks in your JSP programming
Comments
Post a Comment