通过JSTL+EL实现循环迭代
来源:互联网 发布:雪梨淘宝店叫什么名字 编辑:程序博客网 时间:2024/06/06 01:32
使用前需要导入包 jstl.jar 和 standard.jar
<%@ page language="java" import="java.util.*,com.wzh.test.*" pageEncoding="UTF-8"%><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <base href="<%=basePath%>"> <title>使用el+jstl完成数据迭代</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body><br> <% List list=new ArrayList(); list.add(new Person("aa")); list.add(new Person("bb")); list.add(new Person("cc")); request.setAttribute("slist", list); %> <c:forEach items="${slist }" var="person"> ${person.name} </br> </c:forEach> <% Map map = new HashMap(); map.put("aa", new Person("aaa")); map.put("bb11", new Person("bbb")); request.setAttribute("smap", map); %> <c:forEach items="${smap }" var="entry"> ${entry.key } : ${entry.value.name } </br> </c:forEach> <c:if test="${user!=null }"> 欢迎您:${user.username } </c:if> <c:if test="${user==null }"> 请登录 </c:if> </body></html>
0 0
- 通过JSTL+EL实现循环迭代
- javaweb之jstl+el完成数据迭代
- js el jstl list 循环
- jstl 迭代标签
- jstl迭代标签
- javaWeb jstl的基本库的定义, 迭代循环, 条件判断
- javaWeb jstl的基本库的定义, 迭代循环, 条件判断
- JSTL 的forEach标签循环迭代集合并逆序输出
- 用JSTL 迭代 Map
- jstl+el
- el+JSTL
- el,jstl
- EL&JSTL
- el+jstl
- EL、JSTL
- jstl el <%%>
- EL JSTL
- jstl el
- Java 语言中 Enum 类型的使用介绍
- html基础简介
- 黑马程序员—Java集合框架及Java中的几个工具类
- 使用doxygen排版数学公式出错的解决方法
- 自动化测试页面上对hidden控件的处理
- 通过JSTL+EL实现循环迭代
- 神马都是浮云,unity中自己写Coroutine协程源码
- C++命名空间
- POJ 2081 Recaman's Sequence(水~)
- html元素解释
- 二维码框架ZBarSDK的使用和自定义二维码扫描界面方法
- 闭包错误-Cannot invoke 'responseResult' with an argument list of type
- Invert Binary Tree
- 软件开发过程学习笔记(一)之软件开发流程