struts 路径

<!-- ========== Action Definitions ============================== -->

<action path="/orderBill" scope="request"
   type="com.sinosoft.chint.purchase.action.OrderBillAction">
   <forward name="save" path="/jsp/purchase/orderbillsavenew.jsp" />
   <forward name="confirm" path="/jsp/purchase/orderBillSaveConfirm.jsp" />
  </action>

《!--========== js ======================  -->

//提交单据
function billsubmit(){
  form1.action = "/orderBill.do?op=submit";
  checkprod();
}

 

 

出现错误 (/orderBill.do)  is  not available

原因为 在action中“path="/orderBill"”  这个路径直指根路径,如“eg/pr/orderBill” 

       而js中 "/orderBill.do?op=submit" 所用路径为"/orderBill"

其中  eg为项目名  pr为包名

而若设为 form1.action = "orderBill.do?op=submit",则路径为"pr/orderBill

所以修改有两种方式

1、js中添加request.getContextPath()+ "/orderBill.do?op=submit"; 这样为根路径,

2、在action中改为path="/pr/orderBill"   而js中改为form1.action = "orderBill.do?op=submit"; (去掉斜杠)

 

 

 

 

 

转载于:https://www.cnblogs.com/ivan-zheng/archive/2010/01/07/1641184.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值