Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. package com.lynas.config;
  2.  
  3. import org.springframework.context.annotation.Bean;
  4. import org.springframework.context.annotation.ComponentScan;
  5. import org.springframework.context.annotation.Configuration;
  6. import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
  7. import org.springframework.web.servlet.config.annotation.EnableWebMvc;
  8. import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
  9. import org.springframework.web.servlet.view.InternalResourceViewResolver;
  10.  
  11. @Configuration
  12. @EnableWebMvc
  13. @ComponentScan("com.lynas")
  14. public class WebConfig extends WebMvcConfigurerAdapter {
  15.  
  16. @Bean
  17. public InternalResourceViewResolver irvr() {
  18. InternalResourceViewResolver irvr = new InternalResourceViewResolver();
  19. irvr.setPrefix("/");
  20. irvr.setSuffix(".jsp");
  21. return irvr;
  22. }
  23.  
  24. @Override
  25. public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
  26. super.configureDefaultServletHandling(configurer);
  27. configurer.enable();
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement