check your viewresolver setup spring boot code example
Example: viewresolver in spring boot
@EnableWebMvc
@Configuration
@ComponentScan("com.baeldung.web")
public class WebConfig implements WebMvcConfigurer {
// All web configuration will go here
}