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/29b9422a Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/29b9422a Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/29b9422a Branch: refs/heads/5299-ajax-strategy Commit: 29b9422adeac165a9bd40a4b86a4819051193cbc Parents: 3e38950 Author: Martin Tzvetanov Grigorov <mgrigo...@apache.org> Authored: Thu Aug 8 09:40:19 2013 +0200 Committer: Martin Tzvetanov Grigorov <mgrigo...@apache.org> Committed: Thu Aug 8 09:44:18 2013 +0200 ---------------------------------------------------------------------- .../resource/loader/BundleStringResourceLoader.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/29b9422a/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; + } } }