Java的c标签的使用

开发工具与关键技术:MyEclipse、java
作者:清晨
撰写时间:2019.5.17
首先在jsp在添加如下的核心标签库就可在jsp中写c标签代码
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

1. 标签

描述:用于在jsp中显示数据,就像<%=>



						结果是:大家好 :欢迎来学习c标签库的out标签

2. 标签

描述:用于保存数据,计算表达式



结果是:set的标签设置的计算是512*2=1024

3. 标签

描述:用于删除数据,清理工作



Before Remove Value:

After Remove Value:

结果是:Before Remove Value:1024 被remove后就没有值的输出 After Remove Value:

4. 标签

描述:主要用来处理产生错误的异常状况,并且将错误信息储存起来

<%int x=5/0; %>

		

The exception is : ${catchException}
There is an exception: ${catchException.message}

结果是:The exception is : java.lang.ArithmeticException: / by zero There is an exception: / by zero

5. 标签

描述:判断表达式的值,如果表达式的值为真则执行其主体内容。



		

在c标签的参数名为ifvalue,value是500*2,if的标签当值大于900就输出,输出的值是->

结果是:在c标签的参数名为ifvalue, value是500*2,if的标签当值大于900就输出,输出的值是->1000

6. 标签

描述:跳转标签



								结果是:将会跳转的www.baidu.com的网站

7. 标签、 标签

描述:forEach遍历的标签数据


		Item 

结果是:Item 1、Item 2、Item 3、Item 4、Item 5

结果是:Hello、your、we

8. 标签、标签、标签

描述:这三个标签是if…else…if…else


	

Your money is :

你没赚到钱money,努力呀

你没赚到钱大于1000money,很好

不知道

结果是:Your money is : 4000 你没赚到钱大于1000money,很好

你可能感兴趣的:(Technology)