summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-08-09 16:56:57 -0400
committerJames Moger <james.moger@gitblit.com>2012-08-09 16:56:57 -0400
commit77e1d2aa1d520c425cd68323a0eb4cfba201b208 (patch)
treef43785c647149cbde0d2debedf63fbf09f84c3ef /src/com
parent629162ad350b7e478173dcacfd88683aa687f3dd (diff)
downloadgitblit-77e1d2aa1d520c425cd68323a0eb4cfba201b208.tar.gz
gitblit-77e1d2aa1d520c425cd68323a0eb4cfba201b208.zip
Redirect to absolute url for repository search box (issue-111)
Diffstat (limited to 'src/com')
-rw-r--r--src/com/gitblit/wicket/pages/RepositoryPage.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.java b/src/com/gitblit/wicket/pages/RepositoryPage.java
index 45822e16..4b5e28d4 100644
--- a/src/com/gitblit/wicket/pages/RepositoryPage.java
+++ b/src/com/gitblit/wicket/pages/RepositoryPage.java
@@ -32,6 +32,8 @@ import org.apache.wicket.markup.html.link.ExternalLink;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
+import org.apache.wicket.protocol.http.RequestUtils;
+import org.apache.wicket.request.target.basic.RedirectRequestTarget;
import org.eclipse.jgit.diff.DiffEntry.ChangeType;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
@@ -364,8 +366,12 @@ public abstract class RepositoryPage extends BasePage {
// this repository is Lucene-indexed
searchPageClass = LuceneSearchPage.class;
}
- setResponsePage(searchPageClass,
- WicketUtils.newSearchParameter(repositoryName, null, searchString, searchType));
+ // use an absolute url to workaround Wicket-Tomcat problems with
+ // mounted url parameters (issue-111)
+ PageParameters params = WicketUtils.newSearchParameter(repositoryName, null, searchString, searchType);
+ String relativeUrl = urlFor(searchPageClass, params).toString();
+ String absoluteUrl = RequestUtils.toAbsolutePath(relativeUrl);
+ getRequestCycle().setRequestTarget(new RedirectRequestTarget(absoluteUrl));
}
}
}