发帖    主题    评论    推荐    标签    作者    订阅    查搜    注册   登陆   关注
 
面向对象 设计模式 领域驱动设计 企业架构 框架 开发教程 微服务 大数据 扩展性 并发编程 事件驱动 分布式 SOA

不懂下面struts页面的集合是什么时候产生的,请高手指教

2004-05-12 22:37
赞助商链接


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<html:html xhtml="true" locale="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Select / Options examples</title>
<html:base />
<link rel="stylesheet" type="text/css" href="../../css/example.css" />
</head>
<body>
<html:link page="/jsp/options/source.jsp">
<img src="../../images/code.gif" width="24" height="24" alt="View Source" class="icon" />
</html:link>
<a href="../../index.jsp"><img src="../../images/return.gif" height="24" width="24" alt="Return to examples page" class="icon" /></a>
<h1>Select / Options examples</h1>
<hr noshade="noshade"/>
<p>View the HTML source to see the generated option values.</p>
<html:form action="/processOptions">
<h2>1. Simple select tags</h2>
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr valign="top">
<td width="33%">
<p>Single select, size=&quot;1&quot; (drop down list)</p>
<p><html:select property="fruit1">
<html:option value="Strawberry">Strawberry</html:option>
<html:option value="Apple">Apple</html:option>
<html:option value="Orange">Orange</html:option>
<html:option value="Pear">Pear</html:option>
<html:option value="Mango">Mango</html:option>
<html:option value="Banana">Banana</html:option>
<html:option value="Pineapple">Pineapple</html:option>
</html:select></p>
</td>
<td width="33%">
<p>Single select, size=&quot;4&quot;</p>
<p><html:select property="fruit2" size="4">
<html:option value="Strawberry">Strawberry</html:option>
<html:option value="Apple">Apple</html:option>
<html:option value="Orange">Orange</html:option>
<html:option value="Pear">Pear</html:option>
<html:option value="Mango">Mango</html:option>
<html:option value="Banana">Banana</html:option>
<html:option value="Pineapple">Pineapple</html:option>
</html:select></p>
</td>
<td width="33%">
<p>Multi-select, size=&quot;7&quot;</p>
<p><html:select property="fruit3" size="7" multiple="true">
<html:option value="Strawberry">Strawberry</html:option>
<html:option value="Apple">Apple</html:option>
<html:option value="Orange">Orange</html:option>
<html:option value="Pear">Pear</html:option>
<html:option value="Mango">Mango</html:option>
<html:option value="Banana">Banana</html:option>
<html:option value="Pineapple">Pineapple</html:option>
</html:select></p>
</td>
</tr>
</table>
<h2>2. Populating options from arrays and collections</h2>
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr>
<td width="33%" valign="top">
<p>Option values and labels populated from the same array:</p>
<p><html:select property="color1" size="7">
<html:options name="colors" />
</html:select>
</p>
</td>
<td width="33%" valign="top">
<p>Option values and labels populated from different arrays:</p>
<p><html:select property="color2" size="7">
<html:options name="colorCodes" labelName="colors" />
</html:select></p>
</td>
<td width="33%" valign="top">
<p>Option values populated from an array and labels populated from a
collection:</p>
<p><html:select property="color3" size="7">
<html:options name="colorCodes" labelName="colorCollection" />
</html:select></p>

</td>
</tr>
</table>
<h2>3. Populating options from a Collection of LabelValueBeans</h2>
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr valign="top">
<td width="33%">
<p>Options populated from a Collection of LabelValueBeans, using
<html:options>:</p>
<p><html:select property="day1" size="7">
<html:options collection="days" property="value"
labelProperty="label" />
</html:select></p>
</td>
<td width="33%">
<p>Options populated from a Collection of LabelValueBeans, using
<html:optionsCollection>:</p>
<p><html:select property="day2" size="7">
<html:optionsCollection name="days" />
</html:select></p>
</td>
<td width="33%">&nbsp;</td>
</tr>
</table>
<h2>4. Populating options from a Collection of custom beans</h2>
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr valign="top">
<td width="33%">
<p>Options populated from a Collection of BookBeans, using<br />
<html:options>:</p>
<p><html:select property="book1" size="7">
<html:options collection="books" property="isbn"
labelProperty="title" />
</html:select></p>
</td>
<td width="33%">
<p>Options populated from a Collection of BookBeans, using<br />
<html:optionsCollection>:</p>
<p><html:select property="book2" size="7">
<html:optionsCollection name="books" value="isbn" label="title" />
</html:select></p>
</td>
<td width="33%">&nbsp;</td>
</tr>
</table>
<h2>4. Populating options from a Map</h2>
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr valign="top">
<td width="33%">
<p>Options populated from a Map, using <br />
<html:options>:</p>
<p><html:select property="animal1" size="5">
<html:options collection="animals" property="key"
labelProperty="value" />
</html:select></p>
</td>
<td width="33%">
<p>Options populated from a Map, using <br />
<html:optionsCollection>:</p>
<p><html:select property="animal2" size="5">
<html:optionsCollection name="animals" value="key" label="value" />
</html:select></p>
</td>
<td width="33%">&nbsp;</td>
</tr>
</table>

<hr />
<p><html:submit />
<html:cancel />
<html:reset />
</p>
</html:form>

</body>
</html:html>

这个里面的colors集合从哪里来的
还有colorCodes集合
以及下面的animals和books集合。压根就没有看到这两个集合在哪里创建的。

http://www.ninsky.com/struts/download/struts-examples.zip

赞助商链接

赞助商链接

返回顶部

移动版 关于本站 使用帮助 联系管理员 最佳分辨率1366x768
OpenSource JIVEJDON Powered by JdonFramework Code © 2002-20 jdon.com