.jsp页面中请求action的几种方式

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。 http://gaochaojs.blog.51cto.com/812546/166697
 
方式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"
                        οnmοuseοver="makevisible(this,0)" οnmοuseοut="makevisible(this,1)"
                        οnclick="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="维护小类"
    οnclick="minisort()" />
</td>
<script type="text/javascript">
        function minisort() 
        { 
            var el = Ext.get("minisort");          
            var mgr = el.getUpdater();
            mgr.update({
            url:'<c:out value='${cpath}'/>/proposal/manageminisortAction.action',
                scripts:true
                     });
        }    
</script>
 
4..< from >实现表单提交(使用struts2中框架时,inputname
<input name="proposalBig.name" bean对象的属性,inputvalue
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"
        οnmοuseοver="makevisible(this,0)" οnmοuseοut="makevisible(this,1)"  value="保存" style="cursor: hand;">
        </td>
</tr>
</table>
</form>
 
本文出自 “南湖矿工技术博客” 博客,请务必保留此出处 http://gaochaojs.blog.51cto.com/812546/166697
本文出自 51CTO.COM技术博客
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值