]> source.dussan.org Git - gitblit.git/commitdiff
fix GitblitRedirectException
authorMartin Spielmann <martin.spielmann@pingunaut.com>
Thu, 28 Jul 2016 15:28:41 +0000 (17:28 +0200)
committerMartin Spielmann <martin.spielmann@pingunaut.com>
Thu, 28 Jul 2016 15:28:41 +0000 (17:28 +0200)
src/main/java/com/gitblit/wicket/GitblitRedirectException.java

index 23ac7efa0c38d2cf0fafb9c5fb63a1f486fd7652..9eb76bfd2652157a4699ca1a7b243e922db51b65 100644 (file)
  */
 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);
        }
 }