Respect servlet context path in URL for top menu items

When Gerrit is deployed under a context path other than "/", top
menu items' URLs don't contain the context path, erroneously assuming
that it is always "/". Generate the correct URL using selfRedirect().

Bug: issue 2391
Change-Id: I9e5ab8587ee696291f71a7291911328765e87704
This commit is contained in:
David Ostrovsky
2014-01-18 16:13:26 +01:00
committed by Shawn Pearce
parent f9fc92b9d4
commit 46a1ffb34f

View File

@@ -896,8 +896,8 @@ public class Gerrit implements EntryPoint {
m.add(atag);
}
private static void addExtensionLink(final LinkMenuBar m, final TopMenuItem item) {
final Anchor atag = anchor(item.getName(), item.getUrl());
private static void addExtensionLink(LinkMenuBar m, TopMenuItem item) {
Anchor atag = anchor(item.getName(), selfRedirect(item.getUrl()));
atag.setTarget(item.getTarget());
if (item.getId() != null) {
atag.getElement().setAttribute("id", item.getId());