D
D
Drunya20182020-02-02 19:12:53
Java
Drunya2018, 2020-02-02 19:12:53

How to configure display of html pages instead of jsp in Spring'e (annotations)?

I tried to configure the display of html pages through the ViewResolver, but it shows that it does not find mapping.

@EnableWebMvc
@Configuration
@ComponentScan(basePackages = "controller")
public class WebConfig implements WebMvcConfigurer {

    @Bean
    public ViewResolver jspViewResolver() {
        InternalResourceViewResolver viewResolver =
                new InternalResourceViewResolver();
        viewResolver.setPrefix("/WEB-INF/views/");
        viewResolver.setSuffix(".html");
        viewResolver.setOrder(1);
        return viewResolver;
    }
}


5e36f4c0906dd434085541.jpeg

What did he do wrong? I googled for half a day (maybe my hands are just crooked).

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question