struts2页面间传值

<form action="orderAction!myOrder" method="post">
<h6 class="prtHeadTitle">确认订单</h6>
<div class="margintop10"></div>
<p>
<strong>名称:</strong>牛肉馄炖
</p>
<hr class="prtLine" />
<p>
<strong>餐厅:</strong>雅山
</p>
<hr class="prtLine" />
<p>
<strong>数量:</strong><input type="text" name="quantity">
</p>
<hr class="prtLine" />
<p>
<strong>价格:</strong>¥6
</p>
<hr class="prtLine" />
<p>下单后立即由雅山送餐。</p>
<%--<a target="_blank" href="orderAction!myOrder" class="featbtn2" onClick="">提交订单
&rarr;</a>--%>
<input name="submit" type="submit" value="提交订单"
class="btn btn-small btn-info"  />

</form>


Action类

package com.efinance.action;


import java.io.IOException;


import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;


import com.efinance.sms.FetionSend;
import com.opensymphony.xwork2.ActionSupport;
import com.utils.Util;
@Component("orderAction")
@Scope("prototype")
public class OrderAction extends ActionSupport{
private String quantity; 
public String myOrder(){
Util.number=quantity;
return "commit_success";
}

public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}


}



<form name="form1" method="post" action="shoppingAction!submit_Order">
<table width="950" border="0" cellspacing="0" cellpadding="0"
align="center">
<tr>
<td><font size="+2">我的购物车</font>
</td>
</tr>
</table>
<table width="963" border="1" cellspacing="0" cellpadding="0"
align="center" bordercolor="#CCCCCC">
<tr>
<td colspan="7">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td height="22" colspan="2" align="center" background=""
class="STYLE1" border="0" cellspacing="0" cellpadding="1">
商品名称</td>


<td width="10%" class="STYLE1" align="center" height="22"
background="">麦包价</td>
<td width="9%" align="center" class="STYLE1" background="">活动价</td>


<td width="9%" align="center" class="STYLE1" height="22"
background="">优惠</td>


<td width="9%" align="center" class="STYLE1" height="22"
background="">数量</td>


<td width="8%" align="center" class="STYLE1" height="22"
background="">删除</td>
</tr>
<tr>
<td width="7%" height="22" align="center" background=""
bgcolor="#FFFFFF" class="STYLE1" border="0" cellspacing="0"
cellpadding="1"><img src="meishi/hundunaiguotie_5.png"
width="62" height="61">
</td>
<td width="48%" align="center" background="" bgcolor="#FFFFFF"
class="STYLE1" border="0" cellspacing="0" cellpadding="1">[雅山]汤鲜味美的牛肉混沌<br />12313240<br />
</td>
<td class="STYLE1" align="center" height="22" background=""
bgcolor="#FFFFFF">¥8</td>
<td align="center" class="STYLE1" background="" bgcolor="#FFFFFF">¥6</td>
<td align="center" class="STYLE1" height="22" background=""
bgcolor="#FFFFFF">¥2</td>
<td align="center" class="STYLE1" height="22" background=""
bgcolor="#FFFFFF"><s:property value="quantity"/></td>
<td align="center" class="STYLE1" height="22" background=""
bgcolor="#FFFFFF"><a>删除</a>
</td>
</tr>
<hr>
<tr>
<td height="22" colspan="7" align="center" background=""
bgcolor="#FFFFFF" class="STYLE1" border="0" cellspacing="0"
cellpadding="1">合计 : ¥ <s:property value="quantity*6"/>
<div align="right">
<input type='hidden' name='price' value=6 id='price'/>
<input type='hidden' name='GoodsNum' value=<s:property value="quantity"/> id='GoodsNum'/>
<input type='hidden' name='amount' value= <s:property value="quantity*6"/> id='amount'/>
<input name="submit2" type="submit" value="去结算"
class="btn btn-small btn-info" />
</div>
</td>
</tr>
</table>
</form>

转载于:https://my.oschina.net/u/1035715/blog/184945

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值