From be0509f310c15bdf2765193cfa3b06fa4abfc87a Mon Sep 17 00:00:00 2001 From: Martin Spielmann Date: Thu, 28 Jul 2016 17:28:41 +0200 Subject: [PATCH] fix GitblitRedirectException --- .../wicket/GitblitRedirectException.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/GitblitRedirectException.java b/src/main/java/com/gitblit/wicket/GitblitRedirectException.java index 23ac7efa..9eb76bfd 100644 --- a/src/main/java/com/gitblit/wicket/GitblitRedirectException.java +++ b/src/main/java/com/gitblit/wicket/GitblitRedirectException.java @@ -15,12 +15,13 @@ */ package com.gitblit.wicket; -import org.apache.wicket.AbstractRestartResponseException; +//import org.apache.wicket.AbstractRestartResponseException; import org.apache.wicket.Page; -import org.apache.wicket.request.cycle.RequestCycle; +import org.apache.wicket.RestartResponseException; +//import org.apache.wicket.request.cycle.RequestCycle; import org.apache.wicket.request.mapper.parameter.PageParameters; -import org.apache.wicket.protocol.http.RequestUtils; -import org.apache.wicket.request.target.basic.RedirectRequestTarget; +//import org.apache.wicket.protocol.http.RequestUtils; +//import org.apache.wicket.request.target.basic.RedirectRequestTarget; /** * This exception bypasses the servlet container rewriting relative redirect @@ -31,7 +32,7 @@ import org.apache.wicket.request.target.basic.RedirectRequestTarget; * * @author James Moger */ -public class GitblitRedirectException extends AbstractRestartResponseException { +public class GitblitRedirectException extends RestartResponseException { private static final long serialVersionUID = 1L; @@ -40,10 +41,11 @@ public class GitblitRedirectException extends AbstractRestartResponseException { } public GitblitRedirectException(Class pageClass, PageParameters params) { - RequestCycle cycle = RequestCycle.get(); - String relativeUrl = cycle.urlFor(pageClass, params).toString(); - String absoluteUrl = RequestUtils.toAbsolutePath(relativeUrl); - cycle.setRequestTarget(new RedirectRequestTarget(absoluteUrl)); - cycle.setRedirect(true); + super(pageClass, params); +// RequestCycle cycle = RequestCycle.get(); +// String relativeUrl = cycle.urlFor(pageClass, params).toString(); +// String absoluteUrl = RequestUtils.toAbsolutePath(relativeUrl); +// cycle.setRequestTarget(new RedirectRequestTarget(absoluteUrl)); +// cycle.setRedirect(true); } } -- 2.39.5