springMVC框架中跳转页面传提示

  • Post author:
  • Post category:其他


@RequestMapping(“getContext”)



public String getPayContext(@RequestParam(value = “page”, defaultValue = “1”) Integer page,



@RequestParam(value = “rows”, defaultValue = “10”) Integer rows, String fromSystem,



HttpSession session, HttpServletRequest request, HttpServletResponse response, Model model) throws IOException {



Map<String, Object> map = new HashMap<String, Object>();



map.put(“startIndex”, (page – 1) * rows);



map.put(“endIndex”, rows);



model.addAttribute(“page”, page);



model.addAttribute(“rows”, rows);



SystemFrom sf = systemFromService.getSystemFrom();



if (sf == null) {






PrintWriter writer = response.getWriter();



writer.println(“<script>alert(‘当前用户未签约’)”+ “</script>”);



writer.println(“<script>window.history.go(-1);</script>”);



writer.flush();



writer.close();



return null;



}


model.addAttribute(“currPage”, page);



model.addAttribute(“totalPage”, totalPage1);


return “context”;   //跳转页面context.jsp


}



版权声明:本文为dll322原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。