From f03cf597771e0efb4bdd6bb1665d83e67f9bbaab Mon Sep 17 00:00:00 2001 From: Martin Spielmann Date: Sat, 30 Jul 2016 11:09:27 +0200 Subject: [PATCH] more replacements for getRelativePathPrefixToContextRoot --- src/main/java/com/gitblit/wicket/panels/BasePanel.java | 3 ++- src/main/java/com/gitblit/wicket/panels/BranchesPanel.java | 2 +- src/main/java/com/gitblit/wicket/panels/TagsPanel.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/panels/BasePanel.java b/src/main/java/com/gitblit/wicket/panels/BasePanel.java index 0f136ffd..f46e10b3 100644 --- a/src/main/java/com/gitblit/wicket/panels/BasePanel.java +++ b/src/main/java/com/gitblit/wicket/panels/BasePanel.java @@ -27,6 +27,7 @@ import org.slf4j.LoggerFactory; import com.gitblit.Constants; import com.gitblit.Keys; +import com.gitblit.utils.GitBlitRequestUtils; import com.gitblit.utils.TimeUtils; import com.gitblit.wicket.GitBlitWebApp; import com.gitblit.wicket.GitBlitWebSession; @@ -56,7 +57,7 @@ public abstract class BasePanel extends Panel { } protected String getContextUrl() { - return getRequest().getRelativePathPrefixToContextRoot(); + return GitBlitRequestUtils.getRelativePathPrefixToContextRoot(); } protected TimeZone getTimeZone() { diff --git a/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java b/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java index bc5cd8df..07cdafd5 100644 --- a/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java @@ -148,7 +148,7 @@ public class BranchesPanel extends BasePanel { fragment.add(new ExternalLink("raw", rawUrl)); fragment.add(new BookmarkablePageLink("metrics", MetricsPage.class, shortUniqRef)); fragment.add(new ExternalLink("syndication", SyndicationServlet.asLink( - getRequest().getRelativePathPrefixToContextRoot(), model.name, + GitBlitRequestUtils.getRelativePathPrefixToContextRoot(), model.name, Repository.shortenRefName(entry.getName()), 0))); if (showDelete) { fragment.add(createDeleteBranchLink(model, entry)); diff --git a/src/main/java/com/gitblit/wicket/panels/TagsPanel.java b/src/main/java/com/gitblit/wicket/panels/TagsPanel.java index 36370842..a681e6ce 100644 --- a/src/main/java/com/gitblit/wicket/panels/TagsPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/TagsPanel.java @@ -32,6 +32,7 @@ import org.eclipse.jgit.lib.Repository; import com.gitblit.models.RefModel; import com.gitblit.servlet.RawServlet; +import com.gitblit.utils.GitBlitRequestUtils; import com.gitblit.utils.JGitUtils; import com.gitblit.utils.StringUtils; import com.gitblit.wicket.WicketUtils; @@ -115,7 +116,7 @@ public class TagsPanel extends BasePanel { .newObjectParameter(repositoryName, entry.getReferencedObjectId() .getName()))); - String contextUrl = RequestCycle.get().getRequest().getRelativePathPrefixToContextRoot(); + String contextUrl = GitBlitRequestUtils.getRelativePathPrefixToContextRoot(); String rawUrl = RawServlet.asLink(contextUrl, repositoryName, entry.displayName, entry.getReferencedObjectId().getName()); fragment.add(new ExternalLink("raw", rawUrl)); -- 2.39.5