Skip to content

Instantly share code, notes, and snippets.

@martin-g
Created August 18, 2014 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martin-g/2f04df5ad4a9b2eb78c8 to your computer and use it in GitHub Desktop.
Save martin-g/2f04df5ad4a9b2eb78c8 to your computer and use it in GitHub Desktop.
ISIS 815
diff --git i/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java w/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
index f5503ec..aff14ab 100644
--- i/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
+++ w/component/viewer/wicket/impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
@@ -45,6 +45,8 @@
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.request.cycle.IRequestCycleListener;
import org.apache.wicket.request.resource.CssResourceReference;
+import org.apache.wicket.resource.loader.ClassStringResourceLoader;
+import org.apache.wicket.resource.loader.IStringResourceLoader;
import org.apache.wicket.settings.IRequestCycleSettings.RenderStrategy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -91,7 +93,6 @@
import org.apache.isis.viewer.wicket.viewer.integration.wicket.ConverterForObjectAdapter;
import org.apache.isis.viewer.wicket.viewer.integration.wicket.ConverterForObjectAdapterMemento;
import org.apache.isis.viewer.wicket.viewer.integration.wicket.WebRequestCycleForIsis;
-import org.apache.isis.viewer.wicket.viewer.settings.IsisResourceSettings;
/**
* Main application, subclassing the Wicket {@link Application} and
@@ -181,22 +182,6 @@ public static IsisWicketApplication get() {
public IsisWicketApplication() {
}
-
- /**
- * Although there are warnings about not overriding this method, it doesn't seem possible
- * to call {@link #setResourceSettings(org.apache.wicket.settings.IResourceSettings)} in the
- * {@link #init()} method.
- */
- @Override
- protected void internalInit() {
- // replace with custom implementation of ResourceSettings that changes the order
- // in which search for i18n properties, to search for the application-specific
- // settings before any other.
- setResourceSettings(new IsisResourceSettings(this));
-
- super.internalInit();
- }
-
/**
* Initializes the application; in particular, bootstrapping the Isis
* backend, and initializing the {@link ComponentFactoryRegistry} to be used
@@ -207,6 +192,17 @@ protected void init() {
try {
super.init();
+ List<IStringResourceLoader> stringResourceLoaders = getResourceSettings().getStringResourceLoaders();
+ Iterator<IStringResourceLoader> stringResourceLoaderIterator = stringResourceLoaders.iterator();
+ while (stringResourceLoaderIterator.hasNext()) {
+ IStringResourceLoader loader = stringResourceLoaderIterator.next();
+ if (loader instanceof ClassStringResourceLoader) {
+ stringResourceLoaderIterator.remove();
+ break;
+ }
+ }
+ stringResourceLoaders.add(0, new ClassStringResourceLoader(getClass()));
+
configureWebJars();
String isisConfigDir = getServletContext().getInitParameter("isis.config.dir");
@martin-g
Copy link
Author

And remove IsisResourceSettings.java completely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment