I know this question has a lot of answers but i cannot solve mine so that is why i decided to put up the question I want to resolve both jsp and html files. Below is my spring resolver configuration
@Bean
public ViewResolver getViewResolver() {
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/WEB-INF/views/");
resolver.setSuffix("");
return resolver;
}
@Override
public void addResourceHandlers(final ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**").addResourceLocations("/WEB-INF/views/static");
}
and controller class is below:
@RequestMapping("/testApi2")
@Controller
public class TestController2
{
@RequestMapping("/showHomePage")
public ModelAndView showHome(){
return new ModelAndView("/static/about.html");
}
}
I have also attached screen shot of my directory structure, it is giving 404 on every request

/WEB-INF/views/. The suffix is an empty string. The view name is/static/about.html. So the concatenation of all this is/WEB-INF/views//static/about.html. Even if the double slash is properly handled, that won't find your about.html file, which is under/WEB-INF/views/static/HTML/about.html.resolver.setSuffix("")toresolver.setSuffix(".html")might help you