<%@ page language="java" pageEncoding="GB18030"%>
<%@ 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>
<html:base />
<title>beandemo01.jsp</title>
</head>
<body>
<bean:define id="str" value="Hello World..."></bean:define>
<h1>${str}</h1>
<h1><bean:write name="str"/></h1>
<%
Map m = new HashMap() ;
m.put("one","1") ;
m.put("two","2") ;
m.put("three","3") ;
// 将Map对象保存在四种属性范围之中
request.setAttribute("namemap",m) ;
%>
<bean:size id="len" name="namemap" scope="request"/>
<h1>长度是:${len}</h1>
<h1>长度是:<bean:write name="len"/></h1>
<%
Collection col = new ArrayList() ;
col.add("MLDN") ;
col.add("lxh") ;
col.add("mole") ;
// 将Map对象保存在四种属性范围之中
request.setAttribute("namecol",col) ;
%>
<bean:size id="len" name="namecol" scope="request"/>
<h1>长度是:${len}</h1>
</body>
</html:html>