方式1.用javascript的location.href -------(实现整个页面刷新)
<table width="95%" border="0" align="center" cellspacing="1"
cellpadding="4">
<tr>
<td align="right">
<input name="button" type="button" class="button01"
onmouseover="makevisible(this,0)" onmouseout="makevisible(this,1)"
onclick="add()" value="增加" style="cursor: hand;">
</td>
</tr>
</table>
</body>
<SCRIPT>
function add(){
location.href="<c:out value='${cpath}'/>/proposal/managesortaddAction.action?id=<c:out value='${item.id}'/>"
}
</SCRIPT>
方式2. 用<a>
2.1用<s:param>
<td>
<a
href='<s:url action="mydraftmodiAction.action" namespace="politics">
<s:param name="peinfouseraccount" value="useraccount" />
<s:param name="sflag" value="sflag" />
</s:url>'><img
src="<%=request.getContextPath()%>/images/icon/modify.gif"
width="16" height="16" border="0" alt="">
</a>
</td>
2.2用"?id="(我比较赞成)
<td>
<a href="<c:out value='${cpath}'/>/proposal/managesortdeleteAction.action?id=<c:out value='${item.id}'/>">
<img src="<c:out value='${cpath}'/>/images/icon/delete.gif"
width="16" height="16" border="0" alt="删除">
</a>
</td>
方式3. 用ext.实现链接进行局部刷新
<td><input type="button" style="cursor: hand" value="维护小类"
onclick="minisort()" />
</td>
<script type="text/javascript">
function minisort()
{
var el = Ext.get("minisort");
var mgr = el.getUpdater();
mgr.update({
scripts:true
});
}
</script>
方式4..用< from >实现表单提交(使用struts2中框架时,input中name
(<input name="proposalBig.name") 为bean对象的属性,input中value
(value='${proposalBig.name}')为输出bean对象的属性的值)
------------------------------------------------------------------------------------------------------------------------------------------
<form action="<c:out value='${cpath}'/>/proposal/managesortsaveAction.action"
method="post">
<table width="95%" border="0" align="center" cellspacing="1"
cellpadding="4" class="contentTable">
<tr>
<td width="25%" class="low">名称</td>
td width="75%" class="lowest">
<input name="proposalBig.name" type="text" class="button01" id=""
width="100%" value='${proposalBig.name}'/>
</td>
<td width="25%" class="lowest"></td>
</tr>
</table>
<table width="95%" border="0" align="center" cellspacing="1"cellpadding="4">
<tr>
<td align="right">
<input name="sortsave" type="submit" class="button01"
onmouseover="makevisible(this,0)" onmouseout="makevisible(this,1)" value="保存" style="cursor: hand;">
</td>
</tr>
</table>
</form>
本文转自 gaochaojs 51CTO博客,原文链接:http://blog.51cto.com/jncumter/166697,如需转载请自行联系原作者