You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/01/21 19:16:02 UTC

[isis] branch master updated: ISIS-2158: fix for credit image resolving to wrong path

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 8da3fa3  ISIS-2158: fix for credit image resolving to wrong path
8da3fa3 is described below

commit 8da3fa39220005d307b0e58f0ada47403036496c
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Jan 21 20:15:49 2020 +0100

    ISIS-2158: fix for credit image resolving to wrong path
---
 .../org/apache/isis/core/config/viewer/wicket/WebAppContextPath.java | 2 +-
 .../apache/isis/viewer/wicket/ui/components/about/AboutPanel.java    | 3 ---
 .../apache/isis/viewer/wicket/ui/components/footer/FooterPanel.java  | 5 ++---
 3 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/core/config/src/main/java/org/apache/isis/core/config/viewer/wicket/WebAppContextPath.java b/core/config/src/main/java/org/apache/isis/core/config/viewer/wicket/WebAppContextPath.java
index 9383c52..942cf5a 100644
--- a/core/config/src/main/java/org/apache/isis/core/config/viewer/wicket/WebAppContextPath.java
+++ b/core/config/src/main/java/org/apache/isis/core/config/viewer/wicket/WebAppContextPath.java
@@ -96,7 +96,7 @@ public class WebAppContextPath implements Serializable {
             return null;
         }
         if(_Resources.isLocalResource(urlOrLocalPath)) {
-            return this.prependContextPath(urlOrLocalPath);
+            return _Strings.prefix(this.prependContextPath(urlOrLocalPath), "/");
         }
         return urlOrLocalPath;
     }
diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/about/AboutPanel.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/about/AboutPanel.java
index c1c1e78..298abfc 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/about/AboutPanel.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/about/AboutPanel.java
@@ -26,13 +26,10 @@ import javax.inject.Named;
 
 import org.apache.wicket.markup.html.basic.Label;
 
-import org.apache.isis.core.config.IsisConfiguration;
 import org.apache.isis.viewer.wicket.model.models.AboutModel;
 import org.apache.isis.viewer.wicket.ui.pages.home.HomePage;
 import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract;
 
-import lombok.val;
-
 /**
  * {@link PanelAbstract Panel} displaying welcome message (as used on
  * {@link HomePage}).
diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/footer/FooterPanel.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/footer/FooterPanel.java
index 72d39f8..988b5a3 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/footer/FooterPanel.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/footer/FooterPanel.java
@@ -34,7 +34,6 @@ import org.apache.wicket.request.mapper.parameter.PageParameters;
 
 import org.apache.isis.core.commons.internal.base._NullSafe;
 import org.apache.isis.core.config.IsisConfiguration.Viewer.Wicket.Credit;
-import org.apache.isis.core.config.viewer.wicket.WebAppContextPath;
 import org.apache.isis.viewer.wicket.model.common.PageParametersUtils;
 import org.apache.isis.viewer.wicket.ui.components.widgets.breadcrumbs.BreadcrumbPanel;
 import org.apache.isis.viewer.wicket.ui.components.widgets.themepicker.ThemeChooser;
@@ -86,7 +85,7 @@ public class FooterPanel extends PanelAbstract<Model<String>> {
         
         if(hasAnyCredits) {
         
-            val webAppContextPath = getServiceRegistry().lookupServiceElseFail(WebAppContextPath.class);
+            val webAppContextPath = super.getWebAppContextPath();
             
             _NullSafe.stream(credits)
             .forEach(credit->{
@@ -98,7 +97,7 @@ public class FooterPanel extends PanelAbstract<Model<String>> {
                 listItem.add(creditLink);
     
                 val imageUrl = webAppContextPath.prependContextPathIfLocal(credit.getImage());
-    
+                
                 creditLink.add(new CreditImage("creditImage", imageUrl));
                 creditLink.add(new CreditName("creditName", credit.getName()));