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.context.annotation.ImportResource;
7 import org.springframework.web.servlet.config.annotation.EnableWebMvc;
8 import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
9 import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
10 import org.springframework.web.servlet.view.InternalResourceViewResolver;
14 @ImportResource("WEB-INF/spring-security.xml")
15 @ComponentScan(basePackages = "compbio.controllers")
16 public class WebConfig extends WebMvcConfigurerAdapter {
19 public InternalResourceViewResolver viewResolver() {
20 InternalResourceViewResolver resolver = new InternalResourceViewResolver();
21 resolver.setPrefix("/WEB-INF/view/");
22 resolver.setSuffix(".jsp");
27 public void addResourceHandlers(ResourceHandlerRegistry registry) {
28 registry.addResourceHandler("/bootstrap-3.0.2/**").addResourceLocations("/bootstrap-3.0.2/");
29 registry.addResourceHandler("/datatables-1.9.4/**").addResourceLocations("/datatables-1.9.4/");
30 registry.addResourceHandler("/css/**").addResourceLocations("/css/");
31 registry.addResourceHandler("/images/**").addResourceLocations("/images/");
32 registry.addResourceHandler("/js/**").addResourceLocations("/js/");
33 registry.addResourceHandler("/results/**").addResourceLocations("/results/");