我是靠谱客的博主 无情纸鹤,这篇文章主要介绍jsp自定义标签if,ifelse,for的实现,现在分享给大家,希望可以做个参考。

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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(95)

评论列表共有 0 条评论

立即
投稿
返回
顶部