InterviewSolution
Saved Bookmarks
| 1. |
What is a ViewResolver? |
|
Answer» In order to render models in the BROWSER without binding the implementing to specific view of technology. View RESOLVER maps the name of the view to actual views. Spring framework COMES with the number of view solvers.
and a few others. @EnableWebMvc @CONFIGURATION @ComponentScan("org.baeldung.web") public class WebConfig IMPLEMENTS WebMvcConfigurer { // All web configuration will go here @Bean public ViewResolver internalResourceViewResolver() { InternalResourceViewResolver bean = new InternalResourceViewResolver(); bean.setViewClass(JstlView.class); bean.setPrefix("/WEB-INF/view/"); bean.setSuffix(".jsp"); return bean; } } |
|