4

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.)

1
  • Please provide code examples. Commented Sep 5, 2019 at 9:21

3 Answers 3

16

Add this dependency

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
Sign up to request clarification or add additional context in comments.

1 Comment

I've got no clues on how it worked but just did
2

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;
    }

Comments

0

I had this issue in my project, it was just solved by making my Controller class as @RestController

ex...

@RestController

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.