String hql=" from CTDepartment ";
List list=evaluateservice.find(hql);
request.setAttribute("depList",list);
首先在action 里面查询全部的把它保存在一个作用域里面然后在页面上遍历
<logic:iterate id="obj" name="depList">
<html:option value="${obj.id}">${obj.name}</html:option>
</logic:iterate>
注意这里的id是随便起的名字,这里的name值是在action里面保存时起的名字。记住千万别搞错啦。
1.关于html标签的用法:
<html:select property="tbusievaluate.orgcode">
<html:optionsCollection label="name" value="id" name="depList" />
</html:select>
注意这里的label 和value值是绑定在depList对象里面的值name属性是在action里面setAttribute里面的值.
2.
<html:optionsCollection property="headList" value="key" label="value"/>
这一种方式是绑定actionform 里面的值 headList 在form 里面有get 和set 方法。
3.
List xmlxlist = TfpjcUtil.getAllXmlx();
request.setAttribute("xmlxlist", xmlxlist);
<html:select property="xmlx" styleId="xmlx">
<html:option value="">----请选择----</html:option>
<html:options collection="xmlxlist" labelProperty="cl_name" property="cl_id" />
</html:select>
这种方法是在后台自己封装一个po 里面有两个字段 一个是cl_id 另一个是 cl_name
4.关于nested标签的用法
<html:form action="/qf/zbpz.TJ?method=insert" method="post">
<nested:nest property="tbusievaluate">
<nested:text property="name" title="指标名称"/>
<nested:textarea property="describe"/>
<nested:select property="evayear" styleId="year" />
</nested>
</html:form>
注意这里的styleId 相当于普通标签的id 属性 。
<nested:nest property="znTask" >
<nested:write property="taskname" />
</nested:nest>
c标签的用法
<c:if test="${obj[4]==0}">
<td class="center">
<input type="button" value="编辑指标" style="cursor: hand" onclick="edit('/qf/zbpz.TJ?method=edit&id=<bean:datapage name="obj" index="0"/>');"/>
</td>
</c:if>
struts标签头文件
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/struts-nested.tld" prefix="nested" %>
JSTL标签头文件
分享到:
相关推荐
本文讲述了使用Struts 2标签的注意事项,并介绍了学习Struts 2标签比较权威的网站。
struts标签 • Bean Tags:该标签库包含的标签可以用来创建bean、访问bean和访问bean的属性。同时提供了依据cookies、headers和parameters的值创建相关bean的能力。 HTML Tags:该标签库包含的标签可以用来创建...
struts2标签使用例子 struts2标签使用例子 struts2标签使用例子struts2标签使用例子
Struts2-Tags_struts2标签用法
struts标签库struts标签库struts标签库struts标签库struts标签库struts标签库struts标签库struts标签库
Struts2标签库Struts2标签库Struts2标签库Struts2标签库Struts2标签库Struts2标签库
struts标签库里面包括struts所有的标签使用源码
struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签struts1标签
struts2使用json注意事项 struts2使用json注意事项 struts2使用json注意事项 struts2使用json注意事项
struts2标签库struts2标签库struts2标签库struts2标签库
Struts标签 Struts标签Struts标签Struts标签Struts标签
1.struts标签的使用 2.struts常用html标签库 3.在STRUTS中如何使用标签
这是一个c#源代码文件,值得一看,你可以学到如何利用来进行图像相加以及一个java中struts标签的用法
struts标签使用中文说明文档 struts标签使用中文说明文档struts标签使用中文说明文档
Struts标签 大全
Struts提供了五个标签库,即:HTML、Bean、Logic、Template和Nested。 HTML 标签 : 用来创建能够和Struts 框架和其他相应的HTML 标签交互的HTML 输入表单 ...Nested标签: 增强对其他的Struts 标签的嵌套使用的能力
Struts 标签 页面跳转 数据库操作 Struts 标签 页面跳转 数据库操作 Struts 标签 页面跳转 数据库操作
常用jstl和struts标签标签的用法
struts标签库,里面详细介绍了如何使用各种struts标签.
主要介绍了struts2的标签的详细使用例子说明