Mountain View


Could not resolve view with name **** in servlet with name 'dispatcherServlet'

Posted On : 08-Oct-2019 [32]



Make sure you added view resolver and override configureDefaultServletHandling() as beolw


@Configuration
@EnableWebMvc
public class TinyUrlWebMvc extends WebMvcConfigurerAdapter{
@Bean
   public ViewResolver getViewResolver() {
       InternalResourceViewResolver resolver = new InternalResourceViewResolver();
       resolver.setPrefix("/WEB-INF/views/");
       resolver.setSuffix(".jsp");
       return resolver;
   }
 
 @Override
   public void configureDefaultServletHandling(
           DefaultServletHandlerConfigurer configurer) {
       configurer.enable();
   }    

}





Related Articles
Recent Articles
Most Viewed Articles