使用redirect重定向url后可以用RedirectAttributes拿到消息并将消息展示到前端
通过attributes.addFlashAttribute方法
@PostMapping("/types")
public String posy(Type type, RedirectAttributes attributes){
Type type1 = typeService.saveType(type);
if
本文介绍如何在Java的Spring框架中使用redirect重定向URL,并通过RedirectAttributes获取消息,将这些消息传递并展示在前端JavaScript应用中。
使用redirect重定向url后可以用RedirectAttributes拿到消息并将消息展示到前端
通过attributes.addFlashAttribute方法
@PostMapping("/types")
public String posy(Type type, RedirectAttributes attributes){
Type type1 = typeService.saveType(type);
if

被折叠的 条评论
为什么被折叠?