diff options
author | Martin Spielmann <martin.spielmann@pingunaut.com> | 2016-07-28 17:28:41 +0200 |
---|---|---|
committer | Martin Spielmann <martin.spielmann@pingunaut.com> | 2016-07-28 17:28:41 +0200 |
commit | be0509f310c15bdf2765193cfa3b06fa4abfc87a (patch) | |
tree | caf92ec13136251c4240dae277a7c42a0d8d67df | |
parent | 9169d04dd253e68727b26a6b8bf45775f1e5d6c9 (diff) | |
download | gitblit-be0509f310c15bdf2765193cfa3b06fa4abfc87a.tar.gz gitblit-be0509f310c15bdf2765193cfa3b06fa4abfc87a.zip |
fix GitblitRedirectException
-rw-r--r-- | src/main/java/com/gitblit/wicket/GitblitRedirectException.java | 22 |
1 files 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 <C extends Page> GitblitRedirectException(Class<C> 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); } } |