如何在JSP页面中编写if-else语句?
该IF...ELSE块开始作为一个普通的Scriptlet,但Scriptlet中在与包括scriptlet标记之间的HTML文本每行关闭。
示例
<%! 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>上面的代码将产生以下结果-
Today is not weekend
热门推荐
10 病人祝福语老师寄语简短
11 新娘生孩子祝福语简短
12 婆婆66岁祝福语简短
13 今天孩子高考祝福语简短
14 送彩票生日祝福语简短
15 分别祝福语简短情话英文
16 画室揭牌仪式祝福语简短
17 女友妈妈生日祝福语简短
18 离别赠言离职祝福语简短