-1

I generated spring boot project that included web and security modules. localhost:8080/login gives me following error:

There was an unexpected error (type=Internal Server Error, status=500). Circular view path [/login.html]: would dispatch back to the current handler URL [/login.html] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)

I've set up controller that is handling this request (works for sure because when I returned requestBody it displayed my message) and I am returning "login". First thing that is new to me is that there is no webapp folder. Instead I found resources/template and resources/static. I tried many combinations but I always get this error. When I add thymeleaf dependency to my pom.xml then it finds my login.html inside resources/template however I do not want to use thymeleaf as I have already created webpage that has a lot of not closed tags.

So my question is how to properly set up and configure spring boot application without using any templating engine.

@Controller
public class LoginController {

  @RequestMapping(value="/login", method= RequestMethod.GET)
  public String login() {
      return "login";
  }

}

2 Answers2

0

It might be helpful to post the source to your controller so that we can see the annotations you are using to map the request.

Per the Static Content section of the Spring Boot reference, static content such as plain HTML files, JavaScript or images can be placed under src/main/resources/static or src/main/resources/public (there are some other options as well, but these are probably easiest). If you remove the Thymeleaf dependency, and just place login.html in src/main/resources/public, that should get you closer to what you are looking for.

Or you can take this as an opportunity to make your login.html XHTML / HTML 5 compliant, in which case you can avail yourself of Thymeleaf's features.

0

This does not answer my question however I did found a walk around to using thymeleaf.

I added following dependency to pom.xml:

<dependency>
    <groupId>net.sourceforge.nekohtml</groupId>
    <artifactId>nekohtml</artifactId>
</dependency>

And such property to applications.properties spring.thymeleaf.mode=LEGACYHTML5

Now thymeleaf parses my html files without a problem.