Skip to content

Instantly share code, notes, and snippets.

@lynas
Created July 24, 2017 08:44
Show Gist options
  • Save lynas/7139e1769da8e8099bbfd9deee751e1b to your computer and use it in GitHub Desktop.
Save lynas/7139e1769da8e8099bbfd9deee751e1b to your computer and use it in GitHub Desktop.
package com.lynas.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
@Configuration
@EnableWebMvc
@ComponentScan("com.lynas")
public class WebConfig extends WebMvcConfigurerAdapter {
@Bean
public InternalResourceViewResolver irvr() {
InternalResourceViewResolver irvr = new InternalResourceViewResolver();
irvr.setPrefix("/");
irvr.setSuffix(".jsp");
return irvr;
}
@Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
super.configureDefaultServletHandling(configurer);
configurer.enable();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment