You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2014/01/09 16:20:45 UTC

svn commit: r1556831 - in /syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console: SyncopeRequestCycleListener.java pages/ErrorPage.java

Author: ilgrosso
Date: Thu Jan  9 15:20:45 2014
New Revision: 1556831

URL: http://svn.apache.org/r1556831
Log:
[SYNCOPE-475] Changing ComponentRenderingRequestHandler with RenderPageRequestHandler in SyncopeRequestCycleListener

Modified:
    syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/SyncopeRequestCycleListener.java
    syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/ErrorPage.java

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/SyncopeRequestCycleListener.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/SyncopeRequestCycleListener.java?rev=1556831&r1=1556830&r2=1556831&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/SyncopeRequestCycleListener.java (original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/SyncopeRequestCycleListener.java Thu Jan  9 15:20:45 2014
@@ -21,7 +21,8 @@ package org.apache.syncope.console;
 import org.apache.syncope.console.pages.ErrorPage;
 import org.apache.wicket.Page;
 import org.apache.wicket.authorization.UnauthorizedInstantiationException;
-import org.apache.wicket.core.request.handler.ComponentRenderingRequestHandler;
+import org.apache.wicket.core.request.handler.PageProvider;
+import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
 import org.apache.wicket.markup.html.pages.ExceptionErrorPage;
 import org.apache.wicket.model.StringResourceModel;
 import org.apache.wicket.protocol.http.PageExpiredException;
@@ -49,10 +50,10 @@ public class SyncopeRequestCycleListener
 
         LOG.error("Exception found", e);
 
-        final Page errorPage;
         PageParameters errorParameters = new PageParameters();
         errorParameters.add("errorTitle", new StringResourceModel("alert", null).getString());
 
+        final Page errorPage;
         if (e instanceof UnauthorizedInstantiationException) {
             errorParameters.add("errorMessage", new StringResourceModel("unauthorizedInstantiationException", null)
                     .getString());
@@ -67,9 +68,7 @@ public class SyncopeRequestCycleListener
             errorParameters.add("errorMessage", new StringResourceModel("pageExpiredException", null).getString());
 
             errorPage = new ErrorPage(errorParameters);
-        } else if (e.getCause() != null && e.getCause().getCause() != null
-                && e.getCause().getCause() instanceof RestClientException) {
-
+        } else if (e.getCause() != null && e.getCause().getCause() instanceof RestClientException) {
             errorParameters.add("errorMessage", new StringResourceModel("restClientException", null).getString());
 
             errorPage = new ErrorPage(errorParameters);
@@ -78,6 +77,6 @@ public class SyncopeRequestCycleListener
             errorPage = new ExceptionErrorPage(e, null);
         }
 
-        return new ComponentRenderingRequestHandler(errorPage);
+        return new RenderPageRequestHandler(new PageProvider(errorPage));
     }
 }

Modified: syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/ErrorPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/ErrorPage.java?rev=1556831&r1=1556830&r2=1556831&view=diff
==============================================================================
--- syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/ErrorPage.java (original)
+++ syncope/branches/1_1_X/console/src/main/java/org/apache/syncope/console/pages/ErrorPage.java Thu Jan  9 15:20:45 2014
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.console.pages;
 
+import org.apache.wicket.Page;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;
 import org.apache.wicket.model.Model;
@@ -36,6 +37,6 @@ public class ErrorPage extends BasePage 
         add(new Label("errorTitle", new Model<String>(parameters.get("errorTitle").toString())));
         add(new Label("errorMessage", new Model<String>(parameters.get("errorMessage").toString())));
 
-        add(new BookmarkablePageLink("home", getApplication().getHomePage()));
+        add(new BookmarkablePageLink<Page>("home", getApplication().getHomePage()));
     }
 }