【发布时间】:2012-07-30 14:48:01
【问题描述】:
我想知道在 Spring MVC 3.1 中重定向后如何读取 flash 属性。
我有以下代码:
@Controller
@RequestMapping("/foo")
public class FooController {
@RequestMapping(value = "/bar", method = RequestMethod.GET)
public ModelAndView handleGet(...) {
// I want to see my flash attributes here!
}
@RequestMapping(value = "/bar", method = RequestMethod.POST)
public ModelAndView handlePost(RedirectAttributes redirectAttrs) {
redirectAttrs.addFlashAttributes("some", "thing");
return new ModelAndView().setViewName("redirect:/foo/bar");
}
}
我错过了什么?
【问题讨论】:
标签: java spring-mvc