Add datatables-1.9.4 and jquery-1.10.2 libraries
[proteocache.git] / server / compbio / spring / WebConfig.java
1 package compbio.spring;
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.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;
11
12 @Configuration
13 @EnableWebMvc
14 @ImportResource("WEB-INF/spring-security.xml")
15 @ComponentScan(basePackages = "compbio.controllers")
16 public class WebConfig extends WebMvcConfigurerAdapter {
17
18         @Bean
19         public InternalResourceViewResolver viewResolver() {
20                 InternalResourceViewResolver resolver = new InternalResourceViewResolver();
21                 resolver.setPrefix("/WEB-INF/view/");
22                 resolver.setSuffix(".jsp");
23                 return resolver;
24         }
25
26         @Override
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/");
34         }
35 }