diff --git a/apps/routerconsole/jsp/config.jsp b/apps/routerconsole/jsp/config.jsp index 0d56b5f59d..538fb8a5f2 100644 --- a/apps/routerconsole/jsp/config.jsp +++ b/apps/routerconsole/jsp/config.jsp @@ -19,13 +19,10 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("Bandwidth limiter")%> diff --git a/apps/routerconsole/jsp/configadvanced.jsp b/apps/routerconsole/jsp/configadvanced.jsp index 53a8b227f5..d8a19e3505 100644 --- a/apps/routerconsole/jsp/configadvanced.jsp +++ b/apps/routerconsole/jsp/configadvanced.jsp @@ -21,14 +21,11 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("Advanced I2P Configuration")%> diff --git a/apps/routerconsole/jsp/configclients.jsp b/apps/routerconsole/jsp/configclients.jsp index 13a4d6f1ba..3d0cf7cda6 100644 --- a/apps/routerconsole/jsp/configclients.jsp +++ b/apps/routerconsole/jsp/configclients.jsp @@ -25,16 +25,8 @@ input.default { width: 1px; height: 1px; visibility: hidden; } <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - " /> - " /> - " /> - - +<%@include file="formhandler.jsi" %> -<% - String pageNonce = formhandler.getNewNonce(); -%> <%=intl._("Client Configuration")%> <%=intl._("The Java clients listed below are started by the router and run in the same JVM.")%> diff --git a/apps/routerconsole/jsp/confighome.jsp b/apps/routerconsole/jsp/confighome.jsp index b8296fcbbb..6be2d9d2e9 100644 --- a/apps/routerconsole/jsp/confighome.jsp +++ b/apps/routerconsole/jsp/confighome.jsp @@ -22,14 +22,7 @@ input.default { <%@include file="confignav.jsi" %> -<% formhandler.storeMethod(request.getMethod()); %> - -" /> - - -<% - String pageNonce = formhandler.getNewNonce(); -%> +<%@include file="formhandler.jsi" %> " /> diff --git a/apps/routerconsole/jsp/configkeyring.jsp b/apps/routerconsole/jsp/configkeyring.jsp index e8b4089371..b2f5ef657c 100644 --- a/apps/routerconsole/jsp/configkeyring.jsp +++ b/apps/routerconsole/jsp/configkeyring.jsp @@ -15,10 +15,7 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> " /> <%=intl._("Keyring")%> @@ -29,7 +26,7 @@ - " > + <%=intl._("Manual Keyring Addition")%> <%=intl._("Enter keys for encrypted remote destinations here.")%> <%=intl._("Keys for local destinations must be entered on the")%> <%=intl._("I2PTunnel page")%>. diff --git a/apps/routerconsole/jsp/configlogging.jsp b/apps/routerconsole/jsp/configlogging.jsp index c6f3ed945a..837ed81b8a 100644 --- a/apps/routerconsole/jsp/configlogging.jsp +++ b/apps/routerconsole/jsp/configlogging.jsp @@ -18,13 +18,10 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("Configure I2P Logging Options")%> diff --git a/apps/routerconsole/jsp/confignet.jsp b/apps/routerconsole/jsp/confignet.jsp index 7fb74500d9..72de18c4f6 100644 --- a/apps/routerconsole/jsp/confignet.jsp +++ b/apps/routerconsole/jsp/confignet.jsp @@ -18,13 +18,10 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("IP and Transport Configuration")%> diff --git a/apps/routerconsole/jsp/configpeer.jsp b/apps/routerconsole/jsp/configpeer.jsp index 9952db5534..b3aed01e6a 100644 --- a/apps/routerconsole/jsp/configpeer.jsp +++ b/apps/routerconsole/jsp/configpeer.jsp @@ -15,13 +15,7 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - - - +<%@include file="formhandler.jsi" %> " /> @@ -31,7 +25,7 @@ %> - " > + diff --git a/apps/routerconsole/jsp/configreseed.jsp b/apps/routerconsole/jsp/configreseed.jsp index 39df228c69..c83ed389dd 100644 --- a/apps/routerconsole/jsp/configreseed.jsp +++ b/apps/routerconsole/jsp/configreseed.jsp @@ -18,14 +18,9 @@ <%@include file="confignav.jsi" %> -<% formhandler.storeMethod(request.getMethod()); %> -" /> -" /> -" /> - - +<%@include file="formhandler.jsi" %> -" > + <%=intl._("Reseeding Configuration")%> <%=intl._("Reseeding is the bootstrapping process used to find other routers when you first install I2P, or when your router has too few router references remaining.")%> <%=intl._("If reseeding has failed, you should first check your network connection.")%> diff --git a/apps/routerconsole/jsp/configservice.jsp b/apps/routerconsole/jsp/configservice.jsp index 303fa4d31c..c6711cc43c 100644 --- a/apps/routerconsole/jsp/configservice.jsp +++ b/apps/routerconsole/jsp/configservice.jsp @@ -15,13 +15,10 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("Shutdown the router")%> <%=intl._("Graceful shutdown lets the router satisfy the agreements it has already made before shutting down, but may take a few minutes.")%> <%=intl._("If you need to kill the router immediately, that option is available as well.")%> diff --git a/apps/routerconsole/jsp/configsidebar.jsp b/apps/routerconsole/jsp/configsidebar.jsp index 074fcfda30..129feaa107 100644 --- a/apps/routerconsole/jsp/configsidebar.jsp +++ b/apps/routerconsole/jsp/configsidebar.jsp @@ -22,17 +22,10 @@ input.default { <%@include file="confignav.jsi" %> -<% formhandler.storeMethod(request.getMethod()); %> - -" /> - +<%@include file="formhandler.jsi" %> <% formhandler.setMovingAction(); %> - -<% - String pageNonce = formhandler.getNewNonce(); -%> " /> diff --git a/apps/routerconsole/jsp/configstats.jsp b/apps/routerconsole/jsp/configstats.jsp index 8a70c84bc4..d6bd67c1e5 100644 --- a/apps/routerconsole/jsp/configstats.jsp +++ b/apps/routerconsole/jsp/configstats.jsp @@ -66,17 +66,13 @@ function toggleAll(category) <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - +<%@include file="formhandler.jsi" %> " /> - " > + <%=intl._("Configure I2P Stat Collection")%> <%=intl._("Enable full stats?")%> <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - " /> - " /> - " /> - " /> - - +<%@include file="formhandler.jsi" %> <%=intl._("NOTE")%>: <%=intl._("The default settings work for most people.")%> @@ -33,7 +27,7 @@ <%=intl._("Change these settings with care, and adjust them if you have problems.")%> - " > + <%=intl._("Note")%>: <%=intl._("Exploratory tunnel setting changes are stored in the router.config file.")%> diff --git a/apps/routerconsole/jsp/configui.jsp b/apps/routerconsole/jsp/configui.jsp index 3177142da9..f1555a8920 100644 --- a/apps/routerconsole/jsp/configui.jsp +++ b/apps/routerconsole/jsp/configui.jsp @@ -28,11 +28,7 @@ input.default { <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - +<%@include file="formhandler.jsi" %> <%=uihelper._("Router Console Theme")%> <% @@ -42,7 +38,6 @@ input.default { consoleNonce = Long.toString(new java.util.Random().nextLong()); System.setProperty("router.consoleNonce", consoleNonce); } - String pageNonce = formhandler.getNewNonce(); %> diff --git a/apps/routerconsole/jsp/configupdate.jsp b/apps/routerconsole/jsp/configupdate.jsp index a792bb07b3..2d2e54d257 100644 --- a/apps/routerconsole/jsp/configupdate.jsp +++ b/apps/routerconsole/jsp/configupdate.jsp @@ -16,17 +16,14 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> " /> - " > + <% /* set hidden default */ %> <% if (updatehelper.canInstall()) { %> diff --git a/apps/routerconsole/jsp/formhandler.jsi b/apps/routerconsole/jsp/formhandler.jsi new file mode 100644 index 0000000000..a773dda8d5 --- /dev/null +++ b/apps/routerconsole/jsp/formhandler.jsi @@ -0,0 +1,33 @@ +<% + /* + * Does the standard setup for all form handlers, then + * displays the message box (which drives the form processing). + * + * Included ~15 times, keep whitespace to a minimum + * + * Include this directly after the line: + * + */ + + // This initializes the RouterContext - must be the first thing + formhandler.setContextId((String)session.getAttribute("i2p.contextId")); + + // Prevents any saves via GET + formhandler.storeMethod(request.getMethod()); + + // Put all the params in the map, some handlers use this instead of individual setters + // We also call all of the setters below. + formhandler.setSettings(request.getParameterMap()); + +%> + + +<% + + // Only call this once per page, do not getProperty("newNonce") elsewhere, + // use the variable instead. + // This shuffles down the nonces, so it must be after getAllMessages() above, + // since it does the form validation. + String pageNonce = formhandler.getNewNonce(); + +%>
diff --git a/apps/routerconsole/jsp/configadvanced.jsp b/apps/routerconsole/jsp/configadvanced.jsp index 53a8b227f5..d8a19e3505 100644 --- a/apps/routerconsole/jsp/configadvanced.jsp +++ b/apps/routerconsole/jsp/configadvanced.jsp @@ -21,14 +21,11 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("Advanced I2P Configuration")%> diff --git a/apps/routerconsole/jsp/configclients.jsp b/apps/routerconsole/jsp/configclients.jsp index 13a4d6f1ba..3d0cf7cda6 100644 --- a/apps/routerconsole/jsp/configclients.jsp +++ b/apps/routerconsole/jsp/configclients.jsp @@ -25,16 +25,8 @@ input.default { width: 1px; height: 1px; visibility: hidden; } <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - " /> - " /> - " /> - - +<%@include file="formhandler.jsi" %> -<% - String pageNonce = formhandler.getNewNonce(); -%> <%=intl._("Client Configuration")%> <%=intl._("The Java clients listed below are started by the router and run in the same JVM.")%> diff --git a/apps/routerconsole/jsp/confighome.jsp b/apps/routerconsole/jsp/confighome.jsp index b8296fcbbb..6be2d9d2e9 100644 --- a/apps/routerconsole/jsp/confighome.jsp +++ b/apps/routerconsole/jsp/confighome.jsp @@ -22,14 +22,7 @@ input.default { <%@include file="confignav.jsi" %> -<% formhandler.storeMethod(request.getMethod()); %> - -" /> - - -<% - String pageNonce = formhandler.getNewNonce(); -%> +<%@include file="formhandler.jsi" %> " /> diff --git a/apps/routerconsole/jsp/configkeyring.jsp b/apps/routerconsole/jsp/configkeyring.jsp index e8b4089371..b2f5ef657c 100644 --- a/apps/routerconsole/jsp/configkeyring.jsp +++ b/apps/routerconsole/jsp/configkeyring.jsp @@ -15,10 +15,7 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> " /> <%=intl._("Keyring")%> @@ -29,7 +26,7 @@ - " > + <%=intl._("Manual Keyring Addition")%> <%=intl._("Enter keys for encrypted remote destinations here.")%> <%=intl._("Keys for local destinations must be entered on the")%> <%=intl._("I2PTunnel page")%>. diff --git a/apps/routerconsole/jsp/configlogging.jsp b/apps/routerconsole/jsp/configlogging.jsp index c6f3ed945a..837ed81b8a 100644 --- a/apps/routerconsole/jsp/configlogging.jsp +++ b/apps/routerconsole/jsp/configlogging.jsp @@ -18,13 +18,10 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("Configure I2P Logging Options")%> diff --git a/apps/routerconsole/jsp/confignet.jsp b/apps/routerconsole/jsp/confignet.jsp index 7fb74500d9..72de18c4f6 100644 --- a/apps/routerconsole/jsp/confignet.jsp +++ b/apps/routerconsole/jsp/confignet.jsp @@ -18,13 +18,10 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("IP and Transport Configuration")%> diff --git a/apps/routerconsole/jsp/configpeer.jsp b/apps/routerconsole/jsp/configpeer.jsp index 9952db5534..b3aed01e6a 100644 --- a/apps/routerconsole/jsp/configpeer.jsp +++ b/apps/routerconsole/jsp/configpeer.jsp @@ -15,13 +15,7 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - - - +<%@include file="formhandler.jsi" %> " /> @@ -31,7 +25,7 @@ %> - " > + diff --git a/apps/routerconsole/jsp/configreseed.jsp b/apps/routerconsole/jsp/configreseed.jsp index 39df228c69..c83ed389dd 100644 --- a/apps/routerconsole/jsp/configreseed.jsp +++ b/apps/routerconsole/jsp/configreseed.jsp @@ -18,14 +18,9 @@ <%@include file="confignav.jsi" %> -<% formhandler.storeMethod(request.getMethod()); %> -" /> -" /> -" /> - - +<%@include file="formhandler.jsi" %> -" > + <%=intl._("Reseeding Configuration")%> <%=intl._("Reseeding is the bootstrapping process used to find other routers when you first install I2P, or when your router has too few router references remaining.")%> <%=intl._("If reseeding has failed, you should first check your network connection.")%> diff --git a/apps/routerconsole/jsp/configservice.jsp b/apps/routerconsole/jsp/configservice.jsp index 303fa4d31c..c6711cc43c 100644 --- a/apps/routerconsole/jsp/configservice.jsp +++ b/apps/routerconsole/jsp/configservice.jsp @@ -15,13 +15,10 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("Shutdown the router")%> <%=intl._("Graceful shutdown lets the router satisfy the agreements it has already made before shutting down, but may take a few minutes.")%> <%=intl._("If you need to kill the router immediately, that option is available as well.")%> diff --git a/apps/routerconsole/jsp/configsidebar.jsp b/apps/routerconsole/jsp/configsidebar.jsp index 074fcfda30..129feaa107 100644 --- a/apps/routerconsole/jsp/configsidebar.jsp +++ b/apps/routerconsole/jsp/configsidebar.jsp @@ -22,17 +22,10 @@ input.default { <%@include file="confignav.jsi" %> -<% formhandler.storeMethod(request.getMethod()); %> - -" /> - +<%@include file="formhandler.jsi" %> <% formhandler.setMovingAction(); %> - -<% - String pageNonce = formhandler.getNewNonce(); -%> " /> diff --git a/apps/routerconsole/jsp/configstats.jsp b/apps/routerconsole/jsp/configstats.jsp index 8a70c84bc4..d6bd67c1e5 100644 --- a/apps/routerconsole/jsp/configstats.jsp +++ b/apps/routerconsole/jsp/configstats.jsp @@ -66,17 +66,13 @@ function toggleAll(category) <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - +<%@include file="formhandler.jsi" %> " /> - " > + <%=intl._("Configure I2P Stat Collection")%> <%=intl._("Enable full stats?")%> <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - " /> - " /> - " /> - " /> - - +<%@include file="formhandler.jsi" %> <%=intl._("NOTE")%>: <%=intl._("The default settings work for most people.")%> @@ -33,7 +27,7 @@ <%=intl._("Change these settings with care, and adjust them if you have problems.")%> - " > + <%=intl._("Note")%>: <%=intl._("Exploratory tunnel setting changes are stored in the router.config file.")%> diff --git a/apps/routerconsole/jsp/configui.jsp b/apps/routerconsole/jsp/configui.jsp index 3177142da9..f1555a8920 100644 --- a/apps/routerconsole/jsp/configui.jsp +++ b/apps/routerconsole/jsp/configui.jsp @@ -28,11 +28,7 @@ input.default { <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - +<%@include file="formhandler.jsi" %> <%=uihelper._("Router Console Theme")%> <% @@ -42,7 +38,6 @@ input.default { consoleNonce = Long.toString(new java.util.Random().nextLong()); System.setProperty("router.consoleNonce", consoleNonce); } - String pageNonce = formhandler.getNewNonce(); %> diff --git a/apps/routerconsole/jsp/configupdate.jsp b/apps/routerconsole/jsp/configupdate.jsp index a792bb07b3..2d2e54d257 100644 --- a/apps/routerconsole/jsp/configupdate.jsp +++ b/apps/routerconsole/jsp/configupdate.jsp @@ -16,17 +16,14 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> " /> - " > + <% /* set hidden default */ %> <% if (updatehelper.canInstall()) { %> diff --git a/apps/routerconsole/jsp/formhandler.jsi b/apps/routerconsole/jsp/formhandler.jsi new file mode 100644 index 0000000000..a773dda8d5 --- /dev/null +++ b/apps/routerconsole/jsp/formhandler.jsi @@ -0,0 +1,33 @@ +<% + /* + * Does the standard setup for all form handlers, then + * displays the message box (which drives the form processing). + * + * Included ~15 times, keep whitespace to a minimum + * + * Include this directly after the line: + * + */ + + // This initializes the RouterContext - must be the first thing + formhandler.setContextId((String)session.getAttribute("i2p.contextId")); + + // Prevents any saves via GET + formhandler.storeMethod(request.getMethod()); + + // Put all the params in the map, some handlers use this instead of individual setters + // We also call all of the setters below. + formhandler.setSettings(request.getParameterMap()); + +%> + + +<% + + // Only call this once per page, do not getProperty("newNonce") elsewhere, + // use the variable instead. + // This shuffles down the nonces, so it must be after getAllMessages() above, + // since it does the form validation. + String pageNonce = formhandler.getNewNonce(); + +%>
<%=intl._("The Java clients listed below are started by the router and run in the same JVM.")%>
@@ -29,7 +26,7 @@
<%=intl._("Enter keys for encrypted remote destinations here.")%> <%=intl._("Keys for local destinations must be entered on the")%> <%=intl._("I2PTunnel page")%>. diff --git a/apps/routerconsole/jsp/configlogging.jsp b/apps/routerconsole/jsp/configlogging.jsp index c6f3ed945a..837ed81b8a 100644 --- a/apps/routerconsole/jsp/configlogging.jsp +++ b/apps/routerconsole/jsp/configlogging.jsp @@ -18,13 +18,10 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("Configure I2P Logging Options")%> diff --git a/apps/routerconsole/jsp/confignet.jsp b/apps/routerconsole/jsp/confignet.jsp index 7fb74500d9..72de18c4f6 100644 --- a/apps/routerconsole/jsp/confignet.jsp +++ b/apps/routerconsole/jsp/confignet.jsp @@ -18,13 +18,10 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("IP and Transport Configuration")%> diff --git a/apps/routerconsole/jsp/configpeer.jsp b/apps/routerconsole/jsp/configpeer.jsp index 9952db5534..b3aed01e6a 100644 --- a/apps/routerconsole/jsp/configpeer.jsp +++ b/apps/routerconsole/jsp/configpeer.jsp @@ -15,13 +15,7 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - - - +<%@include file="formhandler.jsi" %> " /> @@ -31,7 +25,7 @@ %> - " > + diff --git a/apps/routerconsole/jsp/configreseed.jsp b/apps/routerconsole/jsp/configreseed.jsp index 39df228c69..c83ed389dd 100644 --- a/apps/routerconsole/jsp/configreseed.jsp +++ b/apps/routerconsole/jsp/configreseed.jsp @@ -18,14 +18,9 @@ <%@include file="confignav.jsi" %> -<% formhandler.storeMethod(request.getMethod()); %> -" /> -" /> -" /> - - +<%@include file="formhandler.jsi" %> -" > + <%=intl._("Reseeding Configuration")%> <%=intl._("Reseeding is the bootstrapping process used to find other routers when you first install I2P, or when your router has too few router references remaining.")%> <%=intl._("If reseeding has failed, you should first check your network connection.")%> diff --git a/apps/routerconsole/jsp/configservice.jsp b/apps/routerconsole/jsp/configservice.jsp index 303fa4d31c..c6711cc43c 100644 --- a/apps/routerconsole/jsp/configservice.jsp +++ b/apps/routerconsole/jsp/configservice.jsp @@ -15,13 +15,10 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("Shutdown the router")%> <%=intl._("Graceful shutdown lets the router satisfy the agreements it has already made before shutting down, but may take a few minutes.")%> <%=intl._("If you need to kill the router immediately, that option is available as well.")%> diff --git a/apps/routerconsole/jsp/configsidebar.jsp b/apps/routerconsole/jsp/configsidebar.jsp index 074fcfda30..129feaa107 100644 --- a/apps/routerconsole/jsp/configsidebar.jsp +++ b/apps/routerconsole/jsp/configsidebar.jsp @@ -22,17 +22,10 @@ input.default { <%@include file="confignav.jsi" %> -<% formhandler.storeMethod(request.getMethod()); %> - -" /> - +<%@include file="formhandler.jsi" %> <% formhandler.setMovingAction(); %> - -<% - String pageNonce = formhandler.getNewNonce(); -%> " /> diff --git a/apps/routerconsole/jsp/configstats.jsp b/apps/routerconsole/jsp/configstats.jsp index 8a70c84bc4..d6bd67c1e5 100644 --- a/apps/routerconsole/jsp/configstats.jsp +++ b/apps/routerconsole/jsp/configstats.jsp @@ -66,17 +66,13 @@ function toggleAll(category) <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - +<%@include file="formhandler.jsi" %> " /> - " > + <%=intl._("Configure I2P Stat Collection")%> <%=intl._("Enable full stats?")%> <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - " /> - " /> - " /> - " /> - - +<%@include file="formhandler.jsi" %> <%=intl._("NOTE")%>: <%=intl._("The default settings work for most people.")%> @@ -33,7 +27,7 @@ <%=intl._("Change these settings with care, and adjust them if you have problems.")%> - " > + <%=intl._("Note")%>: <%=intl._("Exploratory tunnel setting changes are stored in the router.config file.")%> diff --git a/apps/routerconsole/jsp/configui.jsp b/apps/routerconsole/jsp/configui.jsp index 3177142da9..f1555a8920 100644 --- a/apps/routerconsole/jsp/configui.jsp +++ b/apps/routerconsole/jsp/configui.jsp @@ -28,11 +28,7 @@ input.default { <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - +<%@include file="formhandler.jsi" %> <%=uihelper._("Router Console Theme")%> <% @@ -42,7 +38,6 @@ input.default { consoleNonce = Long.toString(new java.util.Random().nextLong()); System.setProperty("router.consoleNonce", consoleNonce); } - String pageNonce = formhandler.getNewNonce(); %> diff --git a/apps/routerconsole/jsp/configupdate.jsp b/apps/routerconsole/jsp/configupdate.jsp index a792bb07b3..2d2e54d257 100644 --- a/apps/routerconsole/jsp/configupdate.jsp +++ b/apps/routerconsole/jsp/configupdate.jsp @@ -16,17 +16,14 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> " /> - " > + <% /* set hidden default */ %> <% if (updatehelper.canInstall()) { %> diff --git a/apps/routerconsole/jsp/formhandler.jsi b/apps/routerconsole/jsp/formhandler.jsi new file mode 100644 index 0000000000..a773dda8d5 --- /dev/null +++ b/apps/routerconsole/jsp/formhandler.jsi @@ -0,0 +1,33 @@ +<% + /* + * Does the standard setup for all form handlers, then + * displays the message box (which drives the form processing). + * + * Included ~15 times, keep whitespace to a minimum + * + * Include this directly after the line: + * + */ + + // This initializes the RouterContext - must be the first thing + formhandler.setContextId((String)session.getAttribute("i2p.contextId")); + + // Prevents any saves via GET + formhandler.storeMethod(request.getMethod()); + + // Put all the params in the map, some handlers use this instead of individual setters + // We also call all of the setters below. + formhandler.setSettings(request.getParameterMap()); + +%> + + +<% + + // Only call this once per page, do not getProperty("newNonce") elsewhere, + // use the variable instead. + // This shuffles down the nonces, so it must be after getAllMessages() above, + // since it does the form validation. + String pageNonce = formhandler.getNewNonce(); + +%>
diff --git a/apps/routerconsole/jsp/configpeer.jsp b/apps/routerconsole/jsp/configpeer.jsp index 9952db5534..b3aed01e6a 100644 --- a/apps/routerconsole/jsp/configpeer.jsp +++ b/apps/routerconsole/jsp/configpeer.jsp @@ -15,13 +15,7 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - - - +<%@include file="formhandler.jsi" %> " /> @@ -31,7 +25,7 @@ %> - " > + diff --git a/apps/routerconsole/jsp/configreseed.jsp b/apps/routerconsole/jsp/configreseed.jsp index 39df228c69..c83ed389dd 100644 --- a/apps/routerconsole/jsp/configreseed.jsp +++ b/apps/routerconsole/jsp/configreseed.jsp @@ -18,14 +18,9 @@ <%@include file="confignav.jsi" %> -<% formhandler.storeMethod(request.getMethod()); %> -" /> -" /> -" /> - - +<%@include file="formhandler.jsi" %> -" > + <%=intl._("Reseeding Configuration")%> <%=intl._("Reseeding is the bootstrapping process used to find other routers when you first install I2P, or when your router has too few router references remaining.")%> <%=intl._("If reseeding has failed, you should first check your network connection.")%> diff --git a/apps/routerconsole/jsp/configservice.jsp b/apps/routerconsole/jsp/configservice.jsp index 303fa4d31c..c6711cc43c 100644 --- a/apps/routerconsole/jsp/configservice.jsp +++ b/apps/routerconsole/jsp/configservice.jsp @@ -15,13 +15,10 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("Shutdown the router")%> <%=intl._("Graceful shutdown lets the router satisfy the agreements it has already made before shutting down, but may take a few minutes.")%> <%=intl._("If you need to kill the router immediately, that option is available as well.")%> diff --git a/apps/routerconsole/jsp/configsidebar.jsp b/apps/routerconsole/jsp/configsidebar.jsp index 074fcfda30..129feaa107 100644 --- a/apps/routerconsole/jsp/configsidebar.jsp +++ b/apps/routerconsole/jsp/configsidebar.jsp @@ -22,17 +22,10 @@ input.default { <%@include file="confignav.jsi" %> -<% formhandler.storeMethod(request.getMethod()); %> - -" /> - +<%@include file="formhandler.jsi" %> <% formhandler.setMovingAction(); %> - -<% - String pageNonce = formhandler.getNewNonce(); -%> " /> diff --git a/apps/routerconsole/jsp/configstats.jsp b/apps/routerconsole/jsp/configstats.jsp index 8a70c84bc4..d6bd67c1e5 100644 --- a/apps/routerconsole/jsp/configstats.jsp +++ b/apps/routerconsole/jsp/configstats.jsp @@ -66,17 +66,13 @@ function toggleAll(category) <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - +<%@include file="formhandler.jsi" %> " /> - " > + <%=intl._("Configure I2P Stat Collection")%> <%=intl._("Enable full stats?")%> <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - " /> - " /> - " /> - " /> - - +<%@include file="formhandler.jsi" %> <%=intl._("NOTE")%>: <%=intl._("The default settings work for most people.")%> @@ -33,7 +27,7 @@ <%=intl._("Change these settings with care, and adjust them if you have problems.")%> - " > + <%=intl._("Note")%>: <%=intl._("Exploratory tunnel setting changes are stored in the router.config file.")%> diff --git a/apps/routerconsole/jsp/configui.jsp b/apps/routerconsole/jsp/configui.jsp index 3177142da9..f1555a8920 100644 --- a/apps/routerconsole/jsp/configui.jsp +++ b/apps/routerconsole/jsp/configui.jsp @@ -28,11 +28,7 @@ input.default { <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - +<%@include file="formhandler.jsi" %> <%=uihelper._("Router Console Theme")%> <% @@ -42,7 +38,6 @@ input.default { consoleNonce = Long.toString(new java.util.Random().nextLong()); System.setProperty("router.consoleNonce", consoleNonce); } - String pageNonce = formhandler.getNewNonce(); %> diff --git a/apps/routerconsole/jsp/configupdate.jsp b/apps/routerconsole/jsp/configupdate.jsp index a792bb07b3..2d2e54d257 100644 --- a/apps/routerconsole/jsp/configupdate.jsp +++ b/apps/routerconsole/jsp/configupdate.jsp @@ -16,17 +16,14 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> " /> - " > + <% /* set hidden default */ %> <% if (updatehelper.canInstall()) { %> diff --git a/apps/routerconsole/jsp/formhandler.jsi b/apps/routerconsole/jsp/formhandler.jsi new file mode 100644 index 0000000000..a773dda8d5 --- /dev/null +++ b/apps/routerconsole/jsp/formhandler.jsi @@ -0,0 +1,33 @@ +<% + /* + * Does the standard setup for all form handlers, then + * displays the message box (which drives the form processing). + * + * Included ~15 times, keep whitespace to a minimum + * + * Include this directly after the line: + * + */ + + // This initializes the RouterContext - must be the first thing + formhandler.setContextId((String)session.getAttribute("i2p.contextId")); + + // Prevents any saves via GET + formhandler.storeMethod(request.getMethod()); + + // Put all the params in the map, some handlers use this instead of individual setters + // We also call all of the setters below. + formhandler.setSettings(request.getParameterMap()); + +%> + + +<% + + // Only call this once per page, do not getProperty("newNonce") elsewhere, + // use the variable instead. + // This shuffles down the nonces, so it must be after getAllMessages() above, + // since it does the form validation. + String pageNonce = formhandler.getNewNonce(); + +%>
<%=intl._("Reseeding is the bootstrapping process used to find other routers when you first install I2P, or when your router has too few router references remaining.")%> <%=intl._("If reseeding has failed, you should first check your network connection.")%> diff --git a/apps/routerconsole/jsp/configservice.jsp b/apps/routerconsole/jsp/configservice.jsp index 303fa4d31c..c6711cc43c 100644 --- a/apps/routerconsole/jsp/configservice.jsp +++ b/apps/routerconsole/jsp/configservice.jsp @@ -15,13 +15,10 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> - " > + <%=intl._("Shutdown the router")%> <%=intl._("Graceful shutdown lets the router satisfy the agreements it has already made before shutting down, but may take a few minutes.")%> <%=intl._("If you need to kill the router immediately, that option is available as well.")%> diff --git a/apps/routerconsole/jsp/configsidebar.jsp b/apps/routerconsole/jsp/configsidebar.jsp index 074fcfda30..129feaa107 100644 --- a/apps/routerconsole/jsp/configsidebar.jsp +++ b/apps/routerconsole/jsp/configsidebar.jsp @@ -22,17 +22,10 @@ input.default { <%@include file="confignav.jsi" %> -<% formhandler.storeMethod(request.getMethod()); %> - -" /> - +<%@include file="formhandler.jsi" %> <% formhandler.setMovingAction(); %> - -<% - String pageNonce = formhandler.getNewNonce(); -%> " /> diff --git a/apps/routerconsole/jsp/configstats.jsp b/apps/routerconsole/jsp/configstats.jsp index 8a70c84bc4..d6bd67c1e5 100644 --- a/apps/routerconsole/jsp/configstats.jsp +++ b/apps/routerconsole/jsp/configstats.jsp @@ -66,17 +66,13 @@ function toggleAll(category) <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - +<%@include file="formhandler.jsi" %> " /> - " > + <%=intl._("Configure I2P Stat Collection")%> <%=intl._("Enable full stats?")%> <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - " /> - " /> - " /> - " /> - - +<%@include file="formhandler.jsi" %> <%=intl._("NOTE")%>: <%=intl._("The default settings work for most people.")%> @@ -33,7 +27,7 @@ <%=intl._("Change these settings with care, and adjust them if you have problems.")%> - " > + <%=intl._("Note")%>: <%=intl._("Exploratory tunnel setting changes are stored in the router.config file.")%> diff --git a/apps/routerconsole/jsp/configui.jsp b/apps/routerconsole/jsp/configui.jsp index 3177142da9..f1555a8920 100644 --- a/apps/routerconsole/jsp/configui.jsp +++ b/apps/routerconsole/jsp/configui.jsp @@ -28,11 +28,7 @@ input.default { <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - +<%@include file="formhandler.jsi" %> <%=uihelper._("Router Console Theme")%> <% @@ -42,7 +38,6 @@ input.default { consoleNonce = Long.toString(new java.util.Random().nextLong()); System.setProperty("router.consoleNonce", consoleNonce); } - String pageNonce = formhandler.getNewNonce(); %> diff --git a/apps/routerconsole/jsp/configupdate.jsp b/apps/routerconsole/jsp/configupdate.jsp index a792bb07b3..2d2e54d257 100644 --- a/apps/routerconsole/jsp/configupdate.jsp +++ b/apps/routerconsole/jsp/configupdate.jsp @@ -16,17 +16,14 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> " /> - " > + <% /* set hidden default */ %> <% if (updatehelper.canInstall()) { %> diff --git a/apps/routerconsole/jsp/formhandler.jsi b/apps/routerconsole/jsp/formhandler.jsi new file mode 100644 index 0000000000..a773dda8d5 --- /dev/null +++ b/apps/routerconsole/jsp/formhandler.jsi @@ -0,0 +1,33 @@ +<% + /* + * Does the standard setup for all form handlers, then + * displays the message box (which drives the form processing). + * + * Included ~15 times, keep whitespace to a minimum + * + * Include this directly after the line: + * + */ + + // This initializes the RouterContext - must be the first thing + formhandler.setContextId((String)session.getAttribute("i2p.contextId")); + + // Prevents any saves via GET + formhandler.storeMethod(request.getMethod()); + + // Put all the params in the map, some handlers use this instead of individual setters + // We also call all of the setters below. + formhandler.setSettings(request.getParameterMap()); + +%> + + +<% + + // Only call this once per page, do not getProperty("newNonce") elsewhere, + // use the variable instead. + // This shuffles down the nonces, so it must be after getAllMessages() above, + // since it does the form validation. + String pageNonce = formhandler.getNewNonce(); + +%>
<%=intl._("Graceful shutdown lets the router satisfy the agreements it has already made before shutting down, but may take a few minutes.")%> <%=intl._("If you need to kill the router immediately, that option is available as well.")%>
<%=intl._("Enable full stats?")%> <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - " /> - " /> - " /> - " /> - - +<%@include file="formhandler.jsi" %> <%=intl._("NOTE")%>: <%=intl._("The default settings work for most people.")%> @@ -33,7 +27,7 @@ <%=intl._("Change these settings with care, and adjust them if you have problems.")%> - " > + <%=intl._("Note")%>: <%=intl._("Exploratory tunnel setting changes are stored in the router.config file.")%> diff --git a/apps/routerconsole/jsp/configui.jsp b/apps/routerconsole/jsp/configui.jsp index 3177142da9..f1555a8920 100644 --- a/apps/routerconsole/jsp/configui.jsp +++ b/apps/routerconsole/jsp/configui.jsp @@ -28,11 +28,7 @@ input.default { <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - - +<%@include file="formhandler.jsi" %> <%=uihelper._("Router Console Theme")%> <% @@ -42,7 +38,6 @@ input.default { consoleNonce = Long.toString(new java.util.Random().nextLong()); System.setProperty("router.consoleNonce", consoleNonce); } - String pageNonce = formhandler.getNewNonce(); %> diff --git a/apps/routerconsole/jsp/configupdate.jsp b/apps/routerconsole/jsp/configupdate.jsp index a792bb07b3..2d2e54d257 100644 --- a/apps/routerconsole/jsp/configupdate.jsp +++ b/apps/routerconsole/jsp/configupdate.jsp @@ -16,17 +16,14 @@ <%@include file="confignav.jsi" %> - <% formhandler.storeMethod(request.getMethod()); %> - - " /> - +<%@include file="formhandler.jsi" %> " /> - " > + <% /* set hidden default */ %> <% if (updatehelper.canInstall()) { %> diff --git a/apps/routerconsole/jsp/formhandler.jsi b/apps/routerconsole/jsp/formhandler.jsi new file mode 100644 index 0000000000..a773dda8d5 --- /dev/null +++ b/apps/routerconsole/jsp/formhandler.jsi @@ -0,0 +1,33 @@ +<% + /* + * Does the standard setup for all form handlers, then + * displays the message box (which drives the form processing). + * + * Included ~15 times, keep whitespace to a minimum + * + * Include this directly after the line: + * + */ + + // This initializes the RouterContext - must be the first thing + formhandler.setContextId((String)session.getAttribute("i2p.contextId")); + + // Prevents any saves via GET + formhandler.storeMethod(request.getMethod()); + + // Put all the params in the map, some handlers use this instead of individual setters + // We also call all of the setters below. + formhandler.setSettings(request.getParameterMap()); + +%> + + +<% + + // Only call this once per page, do not getProperty("newNonce") elsewhere, + // use the variable instead. + // This shuffles down the nonces, so it must be after getAllMessages() above, + // since it does the form validation. + String pageNonce = formhandler.getNewNonce(); + +%>
<%=intl._("NOTE")%>: <%=intl._("The default settings work for most people.")%> @@ -33,7 +27,7 @@ <%=intl._("Change these settings with care, and adjust them if you have problems.")%>