自动类型转换-jstl表达式

EL不仅简化了变量访问,还具备自动类型转换的功能。以示例 ${param.count + 20} 为例,如果参数 count 的值为 10,那么结果为 30。之前的处理方式为:

String str_count = request.getParameter("count");
int count = Integer.parseInt(str_count);
count = count + 20;

这种自动转换功能使得代码更简洁。

ppt 文件大小:488KB