当我们使用ajax向后台发送请求后,值是交到controller但是无法跳转。
@RequiresPermissions("xxxx:distributor:view") @RequestMapping(value="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); //"redirect:" + Global.getAdminPath() + "/sierac/product/?repage"; return "xxx/distributorGeneralList"; }
$.ajax({ url:'/xxx/distributor/general',type: "post",data: codes,success: function (result) { //由于ajax发送的url到控制层不会进行页面的跳转,因为当请求成功以后,请求依然会回success,所以可以在此处进行跳转 window.location.href="/xxx/distributor/general"; } });