Subversion Repositories SmartDukaan

Rev

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

Rev 21360 Rev 21362
Line 21... Line 21...
21
 
21
 
22
	private static final String PATH_PREFIX="/WEB-INF/views/";
22
	private static final String PATH_PREFIX="/WEB-INF/views/";
23
	private static final String PATH_SUFFIX=".jsp";
23
	private static final String PATH_SUFFIX=".jsp";
24
	private static final String MESSAGE_PATH_SOURCE_NAME="classpath:message";
24
	private static final String MESSAGE_PATH_SOURCE_NAME="classpath:message";
25
	private static final Logger LOGGER=LoggerFactory.getLogger(AppConfig.class);
25
	private static final Logger LOGGER=LoggerFactory.getLogger(AppConfig.class);
-
 
26
	private static Resource resource;
26
	
27
	
-
 
28
	public static Resource getResource() {
-
 
29
		return resource;
-
 
30
	}
-
 
31
 
-
 
32
	public void setResource(Resource resource) {
-
 
33
		AppConfig.resource = resource;
-
 
34
	}
-
 
35
 
27
	@Bean(name = "viewResolver")
36
	@Bean(name = "viewResolver")
28
	public InternalResourceViewResolver getViewResolver() {
37
	public InternalResourceViewResolver getViewResolver() {
29
		LOGGER.debug("creating view resolver bean with prefix : "+PATH_PREFIX+" and suffix : "+PATH_SUFFIX);
38
		LOGGER.debug("creating view resolver bean with prefix : "+PATH_PREFIX+" and suffix : "+PATH_SUFFIX);
30
		InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
39
		InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
31
		viewResolver.setPrefix(PATH_PREFIX);
40
		viewResolver.setPrefix(PATH_PREFIX);
Line 47... Line 56...
47
		return new CommonsMultipartResolver();
56
		return new CommonsMultipartResolver();
48
	}
57
	}
49
 
58
 
50
	@Bean
59
	@Bean
51
	public PropertySourcesPlaceholderConfigurer propertyConfigurer() {
60
	public PropertySourcesPlaceholderConfigurer propertyConfigurer() {
52
		Resource resource;
-
 
53
		String activeProfile;
61
		String activeProfile;
54
 
62
 
55
		PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer =  new PropertySourcesPlaceholderConfigurer();
63
		PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer =  new PropertySourcesPlaceholderConfigurer();
56
		
64
		
57
		Properties properties = new Properties();
65
		Properties properties = new Properties();
Line 74... Line 82...
74
 
82
 
75
		propertySourcesPlaceholderConfigurer.setLocation(resource);
83
		propertySourcesPlaceholderConfigurer.setLocation(resource);
76
 
84
 
77
		return propertySourcesPlaceholderConfigurer;
85
		return propertySourcesPlaceholderConfigurer;
78
	}
86
	}
-
 
87
	
79
}
88
}
80
89