struts 页面传值

 
<%@ page import="org.helpsoft.contract.dto.*" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ page contentType="text/html; charset=gb2312"%>
<%
Ht dto[] = (Ht[]) request.getAttribute( "result" );
%>
<table width="864" border="1" class="bodyTable">
<tr>
       <td>合同编码</td>
       <td>甲方代理人编码</td>
       <td>甲方编码</td>
       <td>签署地点</td>
       <td>乙方</td>
       <td>乙方代理人</td>
       <td>甲方签字日期</td>
       <td>乙方签字日期</td>
       <td>项目名称</td>
       <td>合同内容</td>
</tr>
 
<%
for (int i=0; i<dto.length; i++)
{
       Ht value = dto[i];
%>
<tr>
<td><a href="HtFindByPrimaryKeyResults.do?htbm=<%= value.getHtbm() %>&crudMethod=view"><%= value.getHtbm() %></a></td>
//“?”后面开始设置参数名与参数值。htbm为参数名,<%= value.getHtbm() %>为参数值;&”后可以在写参数名:crudMethod为参数名,view为String型的参数值。.do”以前的HtFindByPrimaryKeyResults为struts-config.xml文件中对应的actiong类。
<td><%= value.getJfdlrbm() %></td>
<td><%= value.getJfbm() %></td>
<td><%= value.getQsdd() %></td>
<td><%= value.getYf() %></td>
<td><%= value.getYfdlr() %></td>
<td><%= value.getJfqzrq() %></td>
<td><%= value.getYfqzrq() %></td>
<td><%= value.getXmmc() %></td>
<td><%= value.getHtnr() %></td>
<td>
<a href="HtFindByPrimaryKeyResults.do?htbm=<%= value.getHtbm() %>&crudMethod=update">编辑</a>
<html:form action="HtFindByPrimaryKeyResults.do" >   //HtFindByPrimaryKeyResultsstruts-config.xml文件中对应的actiong类
<html:hidden property="crudMethod" value="update"/>
//  hidden 是隐藏域<html:hidden />标签可以进行页面传值。property属性中的crudMethod为form类中定义的参数名,value中的update为赋给本页面crudMethod参数的值。也就是说参数名为crudMethod的值等于update
<html:hidden property="htbm" value="<%= value.getHtbm() %>"/>
<input type="submit" value="编辑"/>
</html:form>
</td>
<td>
<a href="HtSave.do?htbm=<%= value.getHtbm() %>&crudMethod=delete">删除</a>
<html:form action="HtSave.do" >
<html:hidden property="crudMethod" value="delete" />
<html:hidden property="htbm" value="<%= value.getHtbm() %>"/>
<html:submit value="删除"/>
</html:form>
</td>
</tr>
<%
}
%>
</table>
 
 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值