做了这步之后 return "redirect:showcustomer";
浏览器的地址栏应该是不是应该变成 <web_root_url>/showcustomer?message=xxxx
了?
@RequestMapping(value="addcustomer", method=RequestMethod.POST)
public String addCustomer(String customer,RedirectAttributes
redirectAttributes) {
redirectAttributes.addFlashAttribute("message","Added
successfully.");
return "redirect:showcustomer";
}
【 在 hahalovenini (hahalovenini) 的大作中提到: 】
: 利用 redirectAttributes 为重定向后的页面传参,但是在最终的showcustomer.jsp
中取不到message的值,怎么办?
: ps:由于jsp文件都在WEB-INF/jsp下面,所以不能直接重定向到jsp页面,必须经过中
间那步showcustomer的请求
: @RequestMapping(value="addcustomer", method=RequestMethod.POST)
: ...................
--
FROM 183.4.61.*