ajax向controller发送请求 页面不跳转到另一个页面
发布时间:2020-12-16 03:20:16 所属栏目:百科 来源:网络整理
导读:@RequestMapping(value="distributor/general") public String allocation_c(Distributor distributor,HttpServletRequest request,HttpServletResponse response,Model model,String codes){ for(codes....){ } PageDistributor page = distributorService.
@RequestMapping(value="distributor/general") public String allocation_c(Distributor distributor,HttpServletRequest request,HttpServletResponse response,Model model,String codes){ for(codes....){ } Page<Distributor> page = distributorService.findPageGeneral(new Page<Distributor>(request,response),distributor); model.addAttribute("page",page); return "xxx/distributorGeneralList"; } $.ajax({ url:'/xxx/distributor/general',type: "post",data: codes,success: function (result) { //由于ajax发送的url到控制层不会进行页面的跳转,因为当请求成功以后,请求依然会回success,所以可以在此再写一遍url进行跳转 window.location.href="/xxx/distributor/general"; } });window.location.href 完美解决问题 页面跳转 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |