当我们使用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) { //@H_403_48@由于ajax@H_403_48@发送的url@H_403_48@到控制层不会进行页面的跳转,因为当请求成功以后,请求依然会回success,@H_403_48@所以可以在此处进行跳转 @H_403_48@ window.location.href="/xxx/distributor/general"; } });