if语句的实现:
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>c:if标签实例</title> <% int a=8; request.setAttribute("aa", a); %> <c:if test="${aa>6}"> a>6 </c:if> </head> <body> </body> </html>
ifelse语句的实现:
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>ifelse标签实例</title> </head> <body> <% int a=7; request.setAttribute("aa", a); %> <c:choose> <c:when test="${aa<5 }">a<5</c:when> <c:otherwise>a>5</c:otherwise> </c:choose> </body> </html>
for语句的实现:
复制代码
1
2
3
4
5
6
7
8
9
10
11<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>for标签实例</title> </head> <body> <c:forEach var="i" begin="0" end="4"> ${i }<br> </c:forEach> </body> </html>
最后
以上就是无情纸鹤最近收集整理的关于jsp自定义标签if,ifelse,for的实现的全部内容,更多相关jsp自定义标签if,ifelse,for内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复