From 60bbdfa46d8ce823ea5954fe72447babbadb3051 Mon Sep 17 00:00:00 2001 From: James Moger Date: Tue, 30 Sep 2014 09:22:37 -0400 Subject: Rename redirect method --- src/main/java/com/gitblit/wicket/pages/BasePage.java | 6 +++--- src/main/java/com/gitblit/wicket/pages/EditMilestonePage.java | 2 +- src/main/java/com/gitblit/wicket/pages/EditTicketPage.java | 4 ++-- src/main/java/com/gitblit/wicket/pages/NewMilestonePage.java | 2 +- src/main/java/com/gitblit/wicket/pages/NewTicketPage.java | 2 +- src/main/java/com/gitblit/wicket/pages/RootPage.java | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/pages/BasePage.java b/src/main/java/com/gitblit/wicket/pages/BasePage.java index 03d19184..b6967003 100644 --- a/src/main/java/com/gitblit/wicket/pages/BasePage.java +++ b/src/main/java/com/gitblit/wicket/pages/BasePage.java @@ -113,11 +113,11 @@ public abstract class BasePage extends SessionPage { return canonicalUrl; } - protected void manualRedirect(Class pageClass) { - redirect(pageClass, null); + protected void redirectTo(Class pageClass) { + redirectTo(pageClass, null); } - protected void redirect(Class pageClass, PageParameters parameters) { + protected void redirectTo(Class pageClass, PageParameters parameters) { String absoluteUrl = getCanonicalUrl(pageClass, parameters); getRequestCycle().setRequestTarget(new RedirectRequestTarget(absoluteUrl)); } diff --git a/src/main/java/com/gitblit/wicket/pages/EditMilestonePage.java b/src/main/java/com/gitblit/wicket/pages/EditMilestonePage.java index 801631e8..6e96526e 100644 --- a/src/main/java/com/gitblit/wicket/pages/EditMilestonePage.java +++ b/src/main/java/com/gitblit/wicket/pages/EditMilestonePage.java @@ -143,7 +143,7 @@ public class EditMilestonePage extends RepositoryPage { } if (success && app().tickets().updateMilestone(getRepositoryModel(), tm, createdBy)) { - redirect(TicketsPage.class, WicketUtils.newOpenTicketsParameter(repositoryName)); + redirectTo(TicketsPage.class, WicketUtils.newOpenTicketsParameter(repositoryName)); } else { // TODO error } diff --git a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java index b55ce9c3..c3d405bc 100644 --- a/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java +++ b/src/main/java/com/gitblit/wicket/pages/EditTicketPage.java @@ -331,13 +331,13 @@ public class EditTicketPage extends RepositoryPage { if (ticket != null) { TicketNotifier notifier = app().tickets().createNotifier(); notifier.sendMailing(ticket); - redirect(TicketsPage.class, WicketUtils.newObjectParameter(getRepositoryModel().name, "" + ticket.number)); + redirectTo(TicketsPage.class, WicketUtils.newObjectParameter(getRepositoryModel().name, "" + ticket.number)); } else { // TODO error } } else { // nothing to change?! - redirect(TicketsPage.class, WicketUtils.newObjectParameter(getRepositoryModel().name, "" + ticket.number)); + redirectTo(TicketsPage.class, WicketUtils.newObjectParameter(getRepositoryModel().name, "" + ticket.number)); } } }); diff --git a/src/main/java/com/gitblit/wicket/pages/NewMilestonePage.java b/src/main/java/com/gitblit/wicket/pages/NewMilestonePage.java index 24a43120..b452a910 100644 --- a/src/main/java/com/gitblit/wicket/pages/NewMilestonePage.java +++ b/src/main/java/com/gitblit/wicket/pages/NewMilestonePage.java @@ -108,7 +108,7 @@ public class NewMilestonePage extends RepositoryPage { if (milestone != null) { milestone.due = due; app().tickets().updateMilestone(getRepositoryModel(), milestone, createdBy); - redirect(TicketsPage.class, WicketUtils.newOpenTicketsParameter(repositoryName)); + redirectTo(TicketsPage.class, WicketUtils.newOpenTicketsParameter(repositoryName)); } else { // TODO error } diff --git a/src/main/java/com/gitblit/wicket/pages/NewTicketPage.java b/src/main/java/com/gitblit/wicket/pages/NewTicketPage.java index f80a7d7e..8f28055a 100644 --- a/src/main/java/com/gitblit/wicket/pages/NewTicketPage.java +++ b/src/main/java/com/gitblit/wicket/pages/NewTicketPage.java @@ -223,7 +223,7 @@ public class NewTicketPage extends RepositoryPage { TicketNotifier notifier = app().tickets().createNotifier(); notifier.sendMailing(ticket); - redirect(TicketsPage.class, WicketUtils.newObjectParameter(getRepositoryModel().name, "" + ticket.number)); + redirectTo(TicketsPage.class, WicketUtils.newObjectParameter(getRepositoryModel().name, "" + ticket.number)); } else { // TODO error } diff --git a/src/main/java/com/gitblit/wicket/pages/RootPage.java b/src/main/java/com/gitblit/wicket/pages/RootPage.java index 15e4304d..43de3b9f 100644 --- a/src/main/java/com/gitblit/wicket/pages/RootPage.java +++ b/src/main/java/com/gitblit/wicket/pages/RootPage.java @@ -280,12 +280,12 @@ public abstract class RootPage extends BasePage { PageParameters params = getPageParameters(); if (params == null) { // redirect to this page - manualRedirect(getClass()); + redirectTo(getClass()); } else { // Strip username and password and redirect to this page params.remove("username"); params.remove("password"); - redirect(getClass(), params); + redirectTo(getClass(), params); } } } -- cgit v1.2.3