I get 404 error and o.s.w.s.r.ResourceHttpRequestHandler : "Path with "WEB-INF" or "META-INF": [WEB-INF/views/main.html]" in logs. APPLICATION PROPERTIES:
spring.mvc.view.prefix=/WEB-INF/views/
spring.mvc.view.suffix=.html
CONTROLLER:
@RestController
@RequestMapping(value = "/main")
public class MainController {
@GetMapping(value = "/")
public ModelAndView showMainPage() {
ModelAndView mv = new ModelAndView();
mv.setViewName("main");
return mv;
}
}
PROJECT STRUCTURE: project structure
After importing into pom.xml it still doesn't work.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>