Circular view path [login]: would dispatch back to the current handler URL [/login] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
3 Answers
Add this dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
1 Comment
testing_22
I've got no clues on how it worked but just did
I added @ResponseBody annotation on the related controller and the problem has solved.
Note: I work on adding an entity by another rest service.
Before:
@PostMapping("/bayiKaydet")
public Bayi bayiKaydet(@RequestBody Bayi bayi) {
serverUrl += "bayiKaydet";
restTemplate.postForEntity(serverUrl, bayi, Bayi.class);
serverUrl = "http://localhost:8090/";
return bayi;
}
After:
@PostMapping("/bayiKaydet")
@ResponseBody
public Bayi bayiKaydet(@RequestBody Bayi bayi) {
serverUrl += "bayiKaydet";
restTemplate.postForEntity(serverUrl, bayi, Bayi.class);
serverUrl = "http://localhost:8090/";
return bayi;
}