有时候在Controller中要redirect跳转到某一个地址,例如: @RequestMapping(value = "/somepath") public String somePath(HttpSession session) { User user = (User) session.getAttribute("user"); if (user != null) { return "someView"; } return "redirect:/login"; } // or @RequestMapping(…