1 package compbio.spring;
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.EnableWebMvc;
7 import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
8 import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
9 import org.springframework.web.servlet.view.InternalResourceViewResolver;
13 @ComponentScan(basePackages = "compbio.controllers")
14 public class WebConfig extends WebMvcConfigurerAdapter {
17 public InternalResourceViewResolver viewResolver() {
18 InternalResourceViewResolver resolver = new InternalResourceViewResolver();
19 resolver.setPrefix("/WEB-INF/view/");
20 resolver.setSuffix(".jsp");
25 public void addResourceHandlers(ResourceHandlerRegistry registry) {
26 registry.addResourceHandler("/bootstrap-3.0.2/**").addResourceLocations("/bootstrap-3.0.2/");
27 registry.addResourceHandler("/css/**").addResourceLocations("/css/");
28 registry.addResourceHandler("/images/**").addResourceLocations("/images/");
29 registry.addResourceHandler("/js/**").addResourceLocations("/js/");