1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.apache.struts2.config;
23
24 import com.opensymphony.xwork2.config.Configuration;
25 import com.opensymphony.xwork2.config.ConfigurationException;
26 import com.opensymphony.xwork2.inject.ContainerBuilder;
27 import com.opensymphony.xwork2.util.location.LocatableProperties;
28
29 /***
30 * Loads the default properties, separate from the usual struts.properties loading
31 */
32 public class DefaultPropertiesProvider extends LegacyPropertiesConfigurationProvider {
33
34 public void destroy() {
35 }
36
37 public void init(Configuration configuration) throws ConfigurationException {
38 }
39
40 public void register(ContainerBuilder builder, LocatableProperties props)
41 throws ConfigurationException {
42
43 Settings defaultSettings = null;
44 try {
45 defaultSettings = new PropertiesSettings("org/apache/struts2/default");
46 } catch (Exception e) {
47 throw new ConfigurationException("Could not find or error in org/apache/struts2/default.properties", e);
48 }
49
50 loadSettings(props, defaultSettings);
51 }
52
53 }