TA的每日心情 | 开心 2021-3-12 23:18 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
<%@page import="java.util.*" %>
<%@ page contentType="text/HTML; charset=GB2312" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%
HashMap animals = new HashMap();
animals.put(new Integer(1), "猫");
animals.put(new Integer(2), "狗");
animals.put(new Integer(3), "马");
animals.put(new Integer(4), "兔子");
animals.put(new Integer(5), "金鱼");
request.setAttribute("animals", animals);
%>
<html>
<head>
<title>一个使用HashMap的Struts例子</title>
</head>
<body bgcolor="#ffffff">
<h1>
一个使用HashMap的Struts例子
</h1>
<logic:iterate id="animals2" name="animals">
<bean:write name="animals2" property="value" />
</logic:iterate>
</body>
</html> |
|