| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.web.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;
|
| 6 |
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
7 |
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
| 7 |
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
8 |
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
| 8 |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
9 |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
| 9 |
|
10 |
|
| - |
|
11 |
import com.spice.profitmandi.web.interceptor.CreateApiRequestInterceptor;
|
| - |
|
12 |
import com.spice.profitmandi.web.model.ProfitMandiWebConstants;
|
| - |
|
13 |
|
| 10 |
@Configuration
|
14 |
@Configuration
|
| 11 |
@EnableWebMvc
|
15 |
@EnableWebMvc
|
| 12 |
@ComponentScan("com.mymarket.shop_status.*")
|
16 |
@ComponentScan("com.spice.profitmandi.*")
|
| 13 |
public class WebMVCConfig extends WebMvcConfigurerAdapter{
|
17 |
public class WebMVCConfig extends WebMvcConfigurerAdapter{
|
| 14 |
|
18 |
|
| 15 |
private static final String RESOURCES_PATTERN="/resources/**";
|
19 |
private static final String RESOURCES_PATTERN="/resources/**";
|
| 16 |
private static final String RESOURCES_LOCATION="/resources/";
|
20 |
private static final String RESOURCES_LOCATION="/resources/";
|
| 17 |
|
21 |
|
| - |
|
22 |
@Autowired
|
| - |
|
23 |
CreateApiRequestInterceptor createApiRequestInterceptor;
|
| 18 |
|
24 |
|
| 19 |
@Override
|
25 |
@Override
|
| 20 |
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
26 |
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
| 21 |
registry.addResourceHandler(RESOURCES_PATTERN).addResourceLocations(RESOURCES_LOCATION);
|
27 |
registry.addResourceHandler(RESOURCES_PATTERN).addResourceLocations(RESOURCES_LOCATION);
|
| 22 |
}
|
28 |
}
|
| 23 |
|
29 |
|
| 24 |
@Override
|
30 |
@Override
|
| 25 |
public void addInterceptors(InterceptorRegistry registry) {
|
31 |
public void addInterceptors(InterceptorRegistry registry) {
|
| 26 |
//registry.addInterceptor(updatePasswordRequestInterceptor).addPathPatterns(ShopStatusWebConstants.URL_HOME_USERS_UPDATE_PASSWORD);
|
32 |
registry.addInterceptor(createApiRequestInterceptor).addPathPatterns(ProfitMandiWebConstants.URL_API);
|
| 27 |
}
|
33 |
}
|
| 28 |
}
|
34 |
}
|
| 29 |
|
35 |
|