You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2021/08/05 22:48:36 UTC

[isis] 02/05: ISIS-2730: catches exception and falls back to welcome page

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

danhaywood pushed a commit to branch ISIS-2728
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 16eb40a5caa4405c2199468162a8ae4e450a805f
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Aug 5 22:49:56 2021 +0100

    ISIS-2730: catches exception and falls back to welcome page
---
 .../org/apache/isis/viewer/wicket/ui/pages/home/HomePage.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/home/HomePage.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/home/HomePage.java
index a66ab45..583c8b2 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/home/HomePage.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/pages/home/HomePage.java
@@ -61,7 +61,14 @@ public class HomePage extends PageAbstract {
 
         if(ManagedObjects.isSpecified(homePageAdapter)) {
             val requestCycle = RequestCycle.get();
-            requestCycle.setResponsePage(new EntityPage(getCommonContext(), homePageAdapter));
+            try {
+                val page = new EntityPage(getCommonContext(), homePageAdapter);
+                requestCycle.setResponsePage(page);
+            } catch (Exception ignore) {
+                // fallback (eg if permissions problem)
+                Components.permanentlyHide(themeDiv, ComponentType.ACTION_PROMPT);
+                getComponentFactoryRegistry().addOrReplaceComponent(themeDiv, ComponentType.WELCOME, null);
+            }
 
         } else {
             Components.permanentlyHide(themeDiv, ComponentType.ACTION_PROMPT);