SpringConfiguration.java 817 B

12345678910111213141516171819202122
  1. package pl.sudra.configuration;
  2. import org.springframework.context.annotation.Bean;
  3. import org.springframework.context.annotation.ComponentScan;
  4. import org.springframework.context.annotation.Configuration;
  5. import org.springframework.web.servlet.config.annotation.EnableWebMvc;
  6. import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
  7. import org.springframework.web.servlet.view.InternalResourceViewResolver;
  8. @Configuration
  9. @EnableWebMvc
  10. @ComponentScan("pl.sudra")
  11. public class SpringConfiguration implements WebMvcConfigurer {
  12. @Bean
  13. public InternalResourceViewResolver viewResolver() {
  14. InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
  15. viewResolver.setPrefix("/");
  16. viewResolver.setSuffix(".jsp");
  17. return viewResolver;
  18. }
  19. }