Java Thymeleaf如何知道使用哪个端点?

Java Thymeleaf如何知道使用哪个端点?,java,thymeleaf,Java,Thymeleaf,“/add person”方法执行重定向到/people。Thymeleaf如何知道重定向到哪个端点?如何重定向到POST方法 @GetMapping("/people") public String getPeopleGet(Model model) { return "people"; } @PostMapping("/people") public String getPeoplePost(Model model) { return "people"; } @GetMa

“/add person”方法执行重定向到/people。Thymeleaf如何知道重定向到哪个端点?如何重定向到POST方法

@GetMapping("/people")
public String getPeopleGet(Model model) {
    return "people";
}

@PostMapping("/people")
public String getPeoplePost(Model model) {
    return "people";
}

@GetMapping("/add-person")
public String addPerson() {
    return "redirect:/person";
}

如果要调用
/people
POST
,并且正在使用
,请将
方法
属性设置为
POST

Thymeleaf根本不参与重定向;这些都发生在HTTP层。如何调用post方法?但是可以直接从Java类中调用吗?