Commits

jcarreira  committed 676f645

wrapping 118n resource bundle loading in a try/catch to keep it from dying if there is no property set.

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@499573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 2c84c41

Comments (0)

Files changed (1)

File src/java/com/opensymphony/webwork/config/DefaultConfiguration.java

         }
 
         // Add addtional list of i18n global resource bundles
-        StringTokenizer bundleFiles = new StringTokenizer((String) config.getImpl("webwork.custom.i18n.resources"), ",");
+        try {
+            StringTokenizer bundleFiles = new StringTokenizer((String) config.getImpl("webwork.custom.i18n.resources"), ",");
 
-        while (bundleFiles.hasMoreTokens()) {
-            String name = bundleFiles.nextToken();
+            while (bundleFiles.hasMoreTokens()) {
+                String name = bundleFiles.nextToken();
 
-            try {
-                log.info("Loading global messages from " + name);
-                LocalizedTextUtil.addDefaultResourceBundle(name);
-            } catch (Exception e) {
-                log.error("Could not find " + name + ".properties. Skipping");
+                try {
+                    log.info("Loading global messages from " + name);
+                    LocalizedTextUtil.addDefaultResourceBundle(name);
+                } catch (Exception e) {
+                    log.error("Could not find " + name + ".properties. Skipping");
+                }
             }
+        } catch (IllegalArgumentException e) {
+            // webwork.custom.i18n.resources wasn't provided
         }
     }