热心网友
回答时间:2024-05-03 11:26
一般在页面取值都是这样做的:
后台在action中request.setAttribute("key",value);
前台在jsp相应的框 value="<%=request.getAttribute("key")%>"就能取出来了。
用textarea的话,就<textarea....><%=request.getAttribute("key")%></textarea>
不管存在哪里,后台都要request.setAttribute("key",value);
前台用request.getAttribute("key")接收。
这里的key可以随便取名字,前后台一样就可以了,
value是要传的值。
另外可以用EL表单提取:
<table width="600" border="1">
<logic:iterate id="item" name="adminForm" property="rows">
<tr>
<td><html:multibox property="ids" value="${item.id}" ></html:multibox></td>
<td>${item.id}</td>
<td>${item.name}</td>
<td>${item.password}</td>
</tr>
</logic:iterate>
</table>
收起