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