Created
July 24, 2017 08:44
-
-
Save lynas/7139e1769da8e8099bbfd9deee751e1b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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