用JSTL 迭代 Map
来源:互联网 发布:mysql默认端口3306 编辑:程序博客网 时间:2024/05/16 00:55
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<%!
public static class TTT{
private String name;
public TTT(String name){
this.name = name;
}
public String getName(){
return name;
}
}
%>
<%
Map map = new LinkedHashMap();
map.put(new TTT("111"),"aaaaaa");
map.put(new TTT("222"),"bbbbbb");
request.setAttribute("map",map);
%>
<body>
<c:forEach items="${map}" var="item">
${item.key.name}-${item.value}<br/>
</c:forEach>
</body>
</html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<%!
public static class TTT{
private String name;
public TTT(String name){
this.name = name;
}
public String getName(){
return name;
}
}
%>
<%
Map map = new LinkedHashMap();
map.put(new TTT("111"),"aaaaaa");
map.put(new TTT("222"),"bbbbbb");
request.setAttribute("map",map);
%>
<body>
<c:forEach items="${map}" var="item">
${item.key.name}-${item.value}<br/>
</c:forEach>
</body>
</html>
- 用JSTL 迭代 Map
- 用JSTL的forEach标签迭代Map对象
- JSTL--foreach 迭代Map对象
- jstl 迭代标签
- jstl迭代标签
- 用Struts2 标签迭代显示 Map
- 用Struts2 标签迭代显示 Map
- 用Struts2 标签迭代显示 Map
- 迭代Map
- Map迭代
- 备忘 - 迭代Map
- Map 迭代
- Map迭代 方式
- 迭代输出map
- map的迭代
- map 如何迭代
- map 如何迭代
- 范型,迭代Map
- 系分复习计划1
- 自用参考
- ACM征途——第一次上传poj 1797作为纪念
- 公元二○○八年7月24日,开始了我的c/c++生涯,加油!
- 从OSCON大会看开源技术运势
- 用JSTL 迭代 Map
- VB6 中 使用Winsock穿越各种代理的实现(TCP协议)
- C#播放器
- c#制作自动播放的mp3
- JSF Datatable 大数据集分页
- OpenAPI的使用代码-判断用户名和密码
- 专注于LargeTables,JSF
- JSF 大数据分页和排序研究
- 微软推出的工作流引擎:Windows Workflow Foudation