struts里关于传递参数的问题 可以做一个HIDDEN,在DELETE时,将该行参数给HIDDEN.因为HIDDEN在FORMBEAN里可以取得,所以在DO里也可以取出来操作 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 谢谢DOGMO2USE(fefe) 对我的建议:我用hidden这个标签试了试,可是参数总是传递不过去,这个是我刚才做的:<html:form action="/member_deleteAction.do" method="post" > <table border="1"> <logic:present name="list"> <logic:iterate id="list" name="list"> <tr> <td> <bean:write name="list"/> <html:hidden name="member_viewForm" property="username" value="<bean:write name='list'>"/> </td> <td> <html:submit value="delete"> </html:submit> </td> </tr> </logic:iterate> </logic:present> </table></html:form>还是不行啊!!!!!急啊!!!!!这样子做应该没有错吧 希望能对你有帮助 <html:form action="/Depart/trash.do"> <table width="790" align="center" cellspacing="1" border="0"> <logic:present name="departmentForm" scope="request"> <tr> <td width="5%"> </td> <td width="19%"> <b><bean:message key="system.dept.id" bundle="cn"/></b> </td> <td width="76%"> <bean:write name="departmentForm" property="departmentcode" scope="request"/> </td> </tr> <tr> <td width="5%"> </td> <td width="19%"> <b><bean:message key="system.dept.name" bundle="cn"/></b> </td> <td width="76%"> <bean:write name="departmentForm" property="departmentname" scope="request"/> </td> </tr> <tr> <td width="5%"> </td> <td width="19%"> <b><bean:message key="system.dept.description" bundle="cn"/></b> </td> <td width="76%"> <bean:write name="departmentForm" property="description" scope="request"/> </td> </tr> </logic:present> <tr> <td height="14" colspan="3"> </td> </tr> <tr> <td width="61"> </td> <td> <html:link href="/ccep/Depart/trash.do" paramId="departmentcode" paramName="departmentForm" paramProperty="departmentcode"> <html:img page="/img/button/delete.gif" border="0"/> </html:link> </td> <td> <html:link page="/Depart/list.do"> <html:img src="/ccep/img/button/cancel.gif" border="0"/> </html:link> </td> </tr> </table> </html:form> 如果是用我的办法的话,那么是在DEL上做一个ONCLICK的JS方法在JS方法里用这种办法document.all.code.value = value;(其中CODE为HIDDEN控件的ID名.等号后面的VALUE为参数)而且HIDDEN不用象你这样在JSP里,只要做一个就可以了,只要点击了DEL的ONCLICK,就将值送出这一个HIDDEN 那个参数传递的问题已经解决了,是用那个<bean:hidden>标签,不过现在又出现了另一个问题,就是我把在数据库里面得结果集放在一个actionform里面,把得到的用户名这n条记录集放在一个AyyayList里面,这个是我的源代码:<html:form action="/member_deleteAction.do" method="post"> <table border="1"> <logic:present name="list"> <logic:iterate id="list" name="list" scope="session"> <tr> <td> <bean:write name="list"/> <html:text name="member_viewForm" property="username"/> <html:hidden name="member_viewForm" property="username" value="username"/> </td> <td> <html:submit value="delete"></html:submit> </td> </tr> </logic:iterate> </logic:present>从那个actionform里面只能取出一个相同字段的值,放在那个text文本里面,这个是为什么呢? 因为你在hidden里指定了value,所以会出这种问题把value这项删掉就行了 用html:hidden吧,用bean:write只能显示,不能传递值的 自学j2ee,求各位学长推荐书本和视频 数据库 Hibernate 中 update 了多余字段 Java 请问:java怎么连接mssql analysis services服务器 问个正则表达式的写法 WebService问题,急求!!! 希望Csdn能真正出一,2个高手帮我解决的邮件内容乱码问题 hibernate 新接触 刚转到Java请各位指点. Hibernate生成的SQL语句中中文都成了乱码。。求助 Cannot find global ActionForward for name /index.do
我用hidden这个标签试了试,可是参数总是传递不过去,这个是我刚才做的:
<html:form action="/member_deleteAction.do" method="post" >
<table border="1">
<logic:present name="list">
<logic:iterate id="list" name="list">
<tr>
<td>
<bean:write name="list"/>
<html:hidden name="member_viewForm" property="username" value="<bean:write name='list'>"/>
</td>
<td>
<html:submit value="delete"> </html:submit>
</td>
</tr>
</logic:iterate>
</logic:present>
</table>
</html:form>
还是不行啊!!!!!急啊!!!!!这样子做应该没有错吧
<html:form action="/Depart/trash.do">
<table width="790" align="center" cellspacing="1" border="0">
<logic:present name="departmentForm" scope="request">
<tr>
<td width="5%"> </td>
<td width="19%">
<b><bean:message key="system.dept.id" bundle="cn"/></b>
</td>
<td width="76%">
<bean:write name="departmentForm" property="departmentcode" scope="request"/>
</td>
</tr>
<tr>
<td width="5%"> </td>
<td width="19%">
<b><bean:message key="system.dept.name" bundle="cn"/></b>
</td>
<td width="76%">
<bean:write name="departmentForm" property="departmentname" scope="request"/>
</td>
</tr>
<tr>
<td width="5%"> </td>
<td width="19%">
<b><bean:message key="system.dept.description" bundle="cn"/></b>
</td>
<td width="76%">
<bean:write name="departmentForm" property="description" scope="request"/>
</td>
</tr>
</logic:present>
<tr>
<td height="14" colspan="3"> </td>
</tr>
<tr>
<td width="61"> </td>
<td>
<html:link href="/ccep/Depart/trash.do" paramId="departmentcode" paramName="departmentForm" paramProperty="departmentcode">
<html:img page="/img/button/delete.gif" border="0"/>
</html:link>
</td>
<td>
<html:link page="/Depart/list.do">
<html:img src="/ccep/img/button/cancel.gif" border="0"/>
</html:link>
</td>
</tr>
</table>
</html:form>
document.all.code.value = value;(其中CODE为HIDDEN控件的ID名.等号后面的VALUE为参数)而且HIDDEN不用象你这样
在JSP里,只要做一个就可以了,只要点击了DEL的ONCLICK,就将值送出这一个HIDDEN
<html:form action="/member_deleteAction.do" method="post">
<table border="1">
<logic:present name="list">
<logic:iterate id="list" name="list" scope="session">
<tr>
<td>
<bean:write name="list"/>
<html:text name="member_viewForm" property="username"/>
<html:hidden name="member_viewForm" property="username" value="username"/>
</td>
<td>
<html:submit value="delete"></html:submit>
</td>
</tr>
</logic:iterate>
</logic:present>
从那个actionform里面只能取出一个相同字段的值,放在那个text文本里面,这个是为什么呢?
把value这项删掉就行了