From: David ‘Bombe’ Roden Date: Wed, 20 Oct 2010 12:49:24 +0000 (+0200) Subject: Honor return page. X-Git-Tag: 0.1-RC1~159 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=594afad9db43aaab0c7b387fb9988b67e7f6bd88;p=Sone.git Honor return page. --- diff --git a/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java b/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java index afac535..4bde0d1 100644 --- a/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java @@ -49,11 +49,12 @@ public class BlockSonePage extends SoneTemplatePage { @Override protected void processTemplate(Request request, Template template) throws RedirectException { super.processTemplate(request, template); - String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone", 36); if (request.getMethod() == Method.POST) { + String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone", 36); + String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 64); getCurrentSone(request.getToadletContext()).addBlockedSoneId(soneId); + throw new RedirectException(returnPage); } - throw new RedirectException("viewSone.html?sone=" + soneId); } //