【发布时间】:2019-03-08 06:20:29
【问题描述】:
我有一个要求,要求我从 post call 重定向到一个新的 URL。这是通过从 post 到新的 get 调用的 URL 重定向来完成的。我正在使用thymeleaf 渲染HTML。
问题是,虽然重定向(从 post 到 get)正在发生,但新的 HTML(在 get 调用中)没有被呈现。
@RequestMapping(value = "/updateUser", method = RequestMethod.POST)
public String updateUser(@RequestBody User user){
/*validations*/
return "redirect:/Table";
}
@RequestMapping(value = '/Table', method = RequestMethod.GET)
public String updateTable(){
return "newPage";
}
即使重定向成功(通过网络调用确认),newPage.html 也不会被呈现。我不明白这里做错了什么,也没有 ERROR 或 WARN 日志。
【问题讨论】:
标签: java spring-boot controller thymeleaf url-redirection