struts1标签之html:optionsCollection
我们常常把一组集合放到每个页面的下拉框中,这里利用struts1的html:optionsCollection可以省很多事。
举个例子:
写一个公共静态方法:
public static Collection<LabelValueBean> getAllType() {
Collection<LabelValueBean> col = new ArrayList<LabelValueBean>();
col.add(new LabelValueBean("所有终端", ""));
col.add(new LabelValueBean("2G全部", "1%"));
col.add(new LabelValueBean("2G手机", "101"));
col.add(new LabelValueBean("3G全部", "2%"));
col.add(new LabelValueBean("3G手机", "201"));
col.add(new LabelValueBean("3G数据卡", "202"));
col.add(new LabelValueBean("3G上网本", "203"));
col.add(new LabelValueBean("3G家庭网关", "204"));
col.add(new LabelValueBean("3G无线固话", "205"));
return col;
}
然后在请求action的时候放到request中。如:request.setAttribute("types",xxx.getAllType());
在页面上可以显示为:
<nested:select property="yourproperty">
<html:optionsCollection name="types"/>
</nested:select>
这样就可以在页面上得到一个下拉列表,这样做的好处之一就是书写简单,方便后期维护
相关文档:
网站开始
从纯的文本可是变成了有字有图的html静态站点
然后从html 变化到了asp php 等动态站点
然后出现ajax 实现了无刷新技术
到了今天一个页面 无跳转
变化可谓真大
我想以后迎接我们的就是
一个页面 桌面式 网上冲浪
flex 这样的技术08年还很少
09年悄悄开始兴起
2010年的现在 开始热播了
......
网页预定义颜色编码列表
const unsigned int gl_color_value[] = {
0xF5F5DC,
0x000000,
0xFF0000,
0xD2B48C,
0xFFD700,
0x008080,
0xF0E68C,
0x00FF00,
0x00FFFF,
0x0000FF,
0x00FFFF,
0xFF7F50,
0x008000,
0xFDF5E6 ......
<script language="C#" runat="server">
void Page_Load(Object sender, EventArgs e) {
Message.InnerHtml = "Welcome to ASP.NET";
}
</script>
...
<span id="Message" style="font-size:24" runat="server"/> ......
<?php
$s = <<<html
<html>
<head>
<title>nested tag test</title>
<mce:script type="text/javascript"><!--
alert('fdsafdasfasd');
// --></mce:script>
</head>
<body>
<div id=0>
<div id=1><img name="im ......