Subversion Repositories SmartDukaan

Rev

Rev 21560 | Rev 21598 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21560 Rev 21561
Line 1... Line 1...
1
package com.spice.profitmandi.config;
1
package com.spice.profitmandi.web.config;
2
 
2
 
-
 
3
import org.springframework.beans.factory.annotation.Autowired;
3
import org.springframework.context.annotation.ComponentScan;
4
import org.springframework.context.annotation.ComponentScan;
4
import org.springframework.context.annotation.Configuration;
5
import org.springframework.context.annotation.Configuration;
5
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
6
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-
 
7
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
6
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
8
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
7
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
9
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
8
 
10
 
-
 
11
import com.spice.profitmandi.web.interceptor.AuthenticationInterceptor;
-
 
12
 
9
@EnableWebMvc
13
@EnableWebMvc
10
@Configuration
14
@Configuration
11
@ComponentScan({"com.spice.profitmandi.*"})
15
@ComponentScan({"com.spice.profitmandi.*"})
12
public class WebConfig extends WebMvcConfigurerAdapter{
16
public class WebConfig extends WebMvcConfigurerAdapter{
13
	
17
	
14
	private static final String RESOURCES_PATTERN="/resources/**";
18
	private static final String RESOURCES_PATTERN="/resources/**";
15
	private static final String RESOURCES_LOCATION="/resources/";
19
	private static final String RESOURCES_LOCATION="/resources/";
16
	
20
	
-
 
21
	@Autowired
-
 
22
	AuthenticationInterceptor authenticationInterceptor;
17
	@Override
23
	@Override
18
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
24
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
19
	   registry.addResourceHandler(RESOURCES_PATTERN).addResourceLocations(RESOURCES_LOCATION);
25
	   registry.addResourceHandler(RESOURCES_PATTERN).addResourceLocations(RESOURCES_LOCATION);
20
	}
26
	}
21
	
27
	
-
 
28
	@Override
-
 
29
	public void addInterceptors(InterceptorRegistry registry) {
-
 
30
		registry.addInterceptor(authenticationInterceptor).addPathPatterns("/**").excludePathPatterns("/login");
-
 
31
	}
-
 
32
	
22
}
33
}