Subversion Repositories SmartDukaan

Rev

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

Rev 23878 Rev 23886
Line 3... Line 3...
3
import java.util.List;
3
import java.util.List;
4
 
4
 
5
import org.springframework.beans.factory.annotation.Autowired;
5
import org.springframework.beans.factory.annotation.Autowired;
6
import org.springframework.context.annotation.ComponentScan;
6
import org.springframework.context.annotation.ComponentScan;
7
import org.springframework.context.annotation.Configuration;
7
import org.springframework.context.annotation.Configuration;
-
 
8
import org.springframework.format.FormatterRegistry;
-
 
9
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar;
8
import org.springframework.http.converter.HttpMessageConverter;
10
import org.springframework.http.converter.HttpMessageConverter;
9
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
11
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
10
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
12
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
11
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
13
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
12
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
14
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
Line 42... Line 44...
42
	public void addInterceptors(InterceptorRegistry registry) {
44
	public void addInterceptors(InterceptorRegistry registry) {
43
		registry.addInterceptor(authenticationInterceptor).addPathPatterns("/**").excludePathPatterns("/login", "/login/", "/", "");
45
		registry.addInterceptor(authenticationInterceptor).addPathPatterns("/**").excludePathPatterns("/login", "/login/", "/", "");
44
		registry.addInterceptor(roleInterceptor).excludePathPatterns("/login", "/login/", "/register", "/register/", "", "/");
46
		registry.addInterceptor(roleInterceptor).excludePathPatterns("/login", "/login/", "/register", "/register/", "", "/");
45
	}
47
	}
46
	
48
	
-
 
49
	@Override
-
 
50
    public void addFormatters(FormatterRegistry registry) {
-
 
51
        DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
-
 
52
        registrar.setUseIsoFormat(true);
-
 
53
        registrar.registerFormatters(registry);
-
 
54
    }
-
 
55
 
-
 
56
	
47
	
57
	
48
	@Override
58
	@Override
49
    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
59
    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
50
 
60
 
51
        converters.add(new MappingJackson2HttpMessageConverter(objectMapper()));
61
        converters.add(new MappingJackson2HttpMessageConverter(objectMapper()));