Add direct link to the job archive file (raw data)
[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("/css/**").addResourceLocations("/css/");
30                 registry.addResourceHandler("/images/**").addResourceLocations("/images/");
31                 registry.addResourceHandler("/js/**").addResourceLocations("/js/");
32                 registry.addResourceHandler("/results/**").addResourceLocations("/results/");
33         }
34 }