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>
这样就可以在页面上得到一个下拉列表,这样做的好处之一就是书写简单,方便后期维护
相关文档:
常用替换 JS(trim,ltrim,rtrim)和替换HTML标签
http://hi.baidu.com/sunsonruby/blog/item/e1bd76d5cc0efec751da4bc9.html
http://sxpyrgz.javaeye.com/blog/397470
<html>
<head>
<title>中国站长天空-网页特效-表单特效-只能输入中文的文本框</title>
<meta http-equiv="content-Type" ......
http://localhost:8080/tj16/
"/"代表根目录,"./" 代表当前目录,"../"代表上级目录。
服务器端的相对地址指的是相对于你的web应用的地址,是在服务器端解析的。(http://localhost:8080/tj16/)
html页面中的相对地址都是相对于服务器根目录,是客户端浏览器解析的。(http://localhost:8080/)
webapp tj16
i:/test/t ......
Html中Label标记的作用和使用介绍
Label标识有两个属性,一个是FOR,一个是ACCESSKEY。
FOR的意思是,这个Lable是为哪个控件服务的;
ACCESSKEY则定义了访问这个控件的热键。
比如,有一个名字叫Name的文本框,<INPUT TYPE="TEXT" ID="Name" SIZE=30>,
那么,<label>就可以定义成:<LABEL FOR="Nam ......
*/
-->
Author:
Thinkhy
Date:
2010.04.11.
Url:
http://www.disandu.com/?p=714
Keyword:
HTML空元素 DIV XSLT jQuery
今天有个HTML空元素的问题折腾了我两个小时,问题是这样的,我要处理一段描述结构化文本的HTML片断:
<div class='paper'>
<div class='questio ......
如何表示上级目录
../表示源文件所在目录的上一级目录,../../表示源文件所在目录的上上级目录,以此类推。
假设info.html路径是:c:\Inetpub\wwwroot\sites\blabla\info.html
假设index.html路径是:c:\Inetpub\wwwroot\sites\index.html
在info.html加入index.html超链接的代码应该这样写:
<a href = "../i ......