From 98e7a6d2b3bcee8d404dc5d6ab0a493f5b7fb4d6 Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 1 Feb 2012 23:03:00 +0000 Subject: [PATCH] Change pagination to use POSTed variable instead of query parameter All wizard pages now have the URL /i2ptunnel/wizard --- apps/i2ptunnel/jsp/wizard.jsp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index 9e9b4fdee..74b61a7c2 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -8,22 +8,25 @@ <% String pageStr = request.getParameter("page"); - int curPage = 1; + int lastPage = 0; if (pageStr != null) { try { - curPage = Integer.parseInt(pageStr); - if (curPage > 7 || curPage <= 0) { - curPage = 1; + lastPage = Integer.parseInt(pageStr); + if (lastPage > 7 || lastPage < 0) { + lastPage = 0; } } catch (NumberFormatException nfe) { - curPage = 1; + lastPage = 0; } } + int curPage = 1; if ("Previous page".equals(request.getParameter("action"))) { - curPage = curPage - 2; - if (curPage <= 0) { - curPage = 1; - } + curPage = lastPage - 1; + } else { + curPage = lastPage + 1; + } + if (curPage > 7 || curPage <= 0) { + curPage = 1; } boolean tunnelIsClient = Boolean.valueOf(request.getParameter("isClient")); String tunnelType = request.getParameter("type"); @@ -46,7 +49,7 @@ -
+ ">
@@ -66,7 +69,7 @@ } else if (curPage == 7) { %>

<%=intl._("Wizard completed")%>

<% } %> - " /> +