Spring Boot, Java Config - No mapping found for HTTP request with URI [/…] in DispatcherServlet with name 'dispatcherServlet'

前端 未结 3 416
春和景丽
春和景丽 2020-12-17 18:50

This has been a quite common problem here in stackOverflow, but none of the topics of the same problem solves mine.

We have a template configuration that uses xml co

3条回答
  •  长情又很酷
    2020-12-17 19:01

    OK! Found the problem.

    This link helped me: https://samerabdelkafi.wordpress.com/2014/08/03/spring-mvc-full-java-based-config/

    More specifically this configuration:

    @Override
        public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
            configurer.enable();
        }
    

    By setting a default handler, I would no longer get a white page but instead the JSP code as html, which clearly tells me that the JSP was being found but not rendered.

    So the answer was on this page: JSP file not rendering in Spring Boot web application

    I was missing the tomcat-embed-jasper artifact.

提交回复
热议问题