spring防止表单重复提交

import org.springframework.web.servlet.mvc.support.RedirectAttributes;

使用RedirectAttributes存放需要传递的数据,然后直接重定向请求。

redirectAttributes.addFlashAttribute("error.password.error","密码格式不正确");
redirectAttributes.addFlashAttribute("user",user);

String returnStr = "redirect:/login";

posted on 2016-04-15 13:34  java疯子  阅读(1198)  评论(0编辑  收藏  举报

导航