jsp页面提交之后,页面无法跳转怎么办?
jsp页面提交之后,页面无法跳转怎么办?
点击“送现场检查”按钮,通过jquery的ajax提交数据,数据提交数据库成功,但是页面没有跳转,还是停留在原来的页面,不知道怎么回事儿?大侠们帮着看看...
jsp中的按钮:<input type="button" name="sendApprove1" value="送现场检查" id="sendApprove1" class="blue_button" style="width:75px;" />
jquery中的ajax提交:
var url = "../../startFlow/sendToApproveRepairOrder.do";
$.ajax({
url:url,
data:{"txr":txr,"txrdw":txrdw,"khmc":khmc,"khhh":khhh,"khdz":khdz,"ssfj":ssfj,"ssxl":ssxl,"zdzch":zdzch, "ljdz":ljdz,"zdlx":zdlx,"zdcj":zdcj,"dbzch":dbzch,"dbcj":dbcj,"dbdz":dbdz,"ctbb":ctbb,"ptbb":ptbb,"byqrl":byqrl,"gznr":gznr,"jhxwgdh":jhxwgdh,"zt":zt,"txrlxdh":txrlxdh,"txsj":txsj,"sdr":sdr,"sdrlxdh":sdrlxdh,"sdrdw":sdrdw,
"sdsj":sdsj,"simkh":simkh,"ygz":ygz,"ygf":ygf,"ygp":ygp,"ygg":ygg},
type:'POST',
//dataType:"json",
success:function(){
//location.href = "../process/jsp/showSendApprove.jsp";
}
});
struts中的配置:
<!-- 工单’送审批‘ 流程实例初始化 -->
<action path="/startFlow/sendToApproveRepairOrder" type="org.springframework.web.struts.DelegatingActionProxy"
parameter="sendToApproveRepairOrder" scope="request">
<forward name="success"
path="/submitWorkFlow/showApproveRepairOrder.do" contextRelative="true">
</forward>
</action>
<!-- 显示流程送审批处理页面 showApproveRepairOrder -->
<action path="/submitWorkFlow/showApproveRepairOrder" type="org.springframework.web.struts.DelegatingActionProxy"
parameter="showApproveRepairOrder" scope="request">
<forward name="success"
path="/process/jsp/showSendApprove.jsp"
contextRelative="true">
</forward>
</action>
------解决方案--------------------
用ajax来提交数据的初衷,就是为了不做页面跳转而实现数据提交和更新啊。
你如果想要页面跳转,就别用ajax了,直接正常的表单提交不就好了?
------解决方案--------------------你想通过第二个action来做跳转的话 就没必要做ajax 如果想做的话 就在ajax的success里头做跳转控制咯
------解决方案--------------------