?? logicdemo06.jsp
字號:
<%@ page language="java" pageEncoding="GBK"%>
<%@ page import="java.util.*"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<html:html lang="true">
<head>
<title>LogicDemo01.jsp</title>
</head>
<body>
<%
/*
要通過迭代標簽輸出Map集合
回顧:Map集合本身不直接支持迭代輸出
輸出步驟:
Map --> Set --> Iterator --> Map.Entry --> key、value
*/
Map m = new HashMap() ;
m.put("name","LiXingHua") ;
m.put("url","www.MLDN.cn") ;
// 將對象保存在屬性之中
request.setAttribute("list",m) ;
%>
<logic:iterate id="str" name="list" scope="request">
<h2>${str.key} --> ${str.value}</h2>
</logic:iterate>
</body>
</html:html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -