<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="">提交订单
→</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"> </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>