in an included library unfortunately the following is done:
@Bean
public WebMvcConfigurer webMvcConfigurerAdapter() {
return new WebMvcConfigurer() {
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/notFound").setViewName("forward:/index.html");
...
}
}
}
How and where can I remove this in my application afterwards? I would like to create a separate error page for it. For other errors except 404 the error page works.
Many greetings
Edit:
@Configuration
@Primary
public class SpringMvcConfiguration {
@Bean
@Primary
public WebMvcConfigurer mywebMvcConfigurerAdapter() {
return new WebMvcConfigurer() {
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/login").setViewName("login");
registry.addViewController("/error").setViewName("error");
registry.addViewController("/notFound").setViewName("notFound");
registry.addViewController("/").setViewName("forward:/index.html");
}
};
}
}
That not work, it fowarded always to index.html