这里是这样的,提交表单后,重定向,在以前的函数里面设置了一些前端的信息。
重定向后,还能显示出来。
最后指定的函数:
@GetMapping("/")
public String getIndex(){
return "index";
}
调用的函数:
@PostMapping("/check")
public String checkCipherAndSendEmail(@RequestParam("cipherString") String cipherString,
@RequestParam("emailString") String emailString,
@RequestParam("urlString") String urlString,
@RequestParam("Ticket") String ticket,
@RequestParam("RandStr") String randStr,
HttpServletRequest request,
RedirectAttributes redirectAttributes){
//TODO something
//业务代码
redirectAttributes.addFlashAttribute("msg", "提示:文件下载成功,正发往指定邮箱");
return "redirect:/";
}
最后
以上就是精明小兔子最近收集整理的关于Spring Boot笔记-使用RedirectAttributes重定向后也可以显示填写的信息的全部内容,更多相关Spring内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复