You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2013/08/08 09:41:53 UTC
git commit: WICKET-5310 if wicket is an external lib,
BundleStringResourceLoader doesn't work
Updated Branches:
refs/heads/wicket-6.x fd863e8c4 -> 000cd8531
WICKET-5310 if wicket is an external lib, BundleStringResourceLoader doesn't work
Fallback to context class loader if a resource cannot be found with the class loader that loaded BundleStringResourceLoader class itself
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/000cd853
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/000cd853
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/000cd853
Branch: refs/heads/wicket-6.x
Commit: 000cd8531bc641960c939e988fee175d8e318935
Parents: fd863e8
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu Aug 8 09:40:19 2013 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu Aug 8 09:40:19 2013 +0200
----------------------------------------------------------------------
.../resource/loader/BundleStringResourceLoader.java | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/000cd853/wicket-core/src/main/java/org/apache/wicket/resource/loader/BundleStringResourceLoader.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/resource/loader/BundleStringResourceLoader.java b/wicket-core/src/main/java/org/apache/wicket/resource/loader/BundleStringResourceLoader.java
index 2c0e4b7..fa4ecfa 100644
--- a/wicket-core/src/main/java/org/apache/wicket/resource/loader/BundleStringResourceLoader.java
+++ b/wicket-core/src/main/java/org/apache/wicket/resource/loader/BundleStringResourceLoader.java
@@ -63,9 +63,16 @@ public class BundleStringResourceLoader implements IStringResourceLoader
{
return ResourceBundle.getBundle(bundleName, locale).getString(key);
}
- catch (MissingResourceException e)
+ catch (MissingResourceException mrx)
{
- return null;
+ try
+ {
+ return ResourceBundle.getBundle(bundleName, locale, Thread.currentThread().getContextClassLoader()).getString(key);
+ }
+ catch (MissingResourceException mrx2)
+ {
+ return null;
+ }
}
}