易截截图软件、单文件、免安装、纯绿色、仅160KB

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到flex

网站开始
从纯的文本可是变成了有字有图的html静态站点
然后从html 变化到了asp  php 等动态站点
然后出现ajax 实现了无刷新技术
到了今天一个页面 无跳转
变化可谓真大
我想以后迎接我们的就是
一个页面 桌面式 网上冲浪
flex 这样的技术08年还很少
09年悄悄开始兴起
2010年的现在 开始热播了
......

asp.net 获取html控件的值的代码

asp.net 获取html控件的值的代码如下:
WebForm1.aspx:
   < INPUT ID="TXT"  TYPE="TEXT" RUNAT="SERVER" VALUE="AAAAAA">  
    < INPUT TYPE="BUTTON" RUNAT="SERVER" VALUE="BTNTEST"  ID="BUTTON1"&nb ......

STRUTS 1.X 通过 JS 获取 STRUTS HTML 标签的相关值

<html:select property='optdwdm' style='width:230' onchange='changedw(this)'>
<html:options collection='dwlist' property='dm' labelProperty='mc' />
</html:select>
在标签的 ONCHANGE 事件里面定义一个 changedw(this)
然后可以通过以下代码获取 html:select  选取的 VALUE ......

html断词

<mce:style type="text/css"><!--
#summary{word-wrap:break-word;width:500px;margin: 0px;padding: 0px;};
.formIn th{white-space: nowrap;}
.formIn{ margin-left: 90px;}

--></mce:style><style type="text/css" mce_bogus="1"> #summary{word-wrap:break-word;width:50 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号