diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java
index ce547cd029..24bbb9119a 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java
@@ -145,7 +145,7 @@ public class IndexBean {
if ( (_action == null) || (_action.trim().length() <= 0) || ("Cancel".equals(_action)))
return "";
if ( (_prevNonce != _curNonce) && (!validPassphrase(_passphrase)) )
- return "Invalid nonce, are you being spoofed?";
+ return "Invalid form submission, probably because you used the 'back' or 'reload' button on your browser. Please resubmit.";
if ("Stop all".equals(_action))
return stopAll();
else if ("Start all".equals(_action))
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/FormHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/FormHandler.java
index 69a39c28cc..e8f5e4d423 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/FormHandler.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/FormHandler.java
@@ -12,7 +12,7 @@ import net.i2p.util.Log;
*
*
* The form is "processed" after the properties are set and the first output
- * property is retrieved - either getNotices() or getErrors().
+ * property is retrieved - either getAll(), getNotices() or getErrors().
*
*/
public class FormHandler {
@@ -21,8 +21,8 @@ public class FormHandler {
private String _nonce;
protected String _action;
protected String _passphrase;
- private List _errors;
- private List _notices;
+ private List _errors;
+ private List _notices;
private boolean _processed;
private boolean _valid;
@@ -78,6 +78,31 @@ public class FormHandler {
_notices.add(msg);
}
+ /**
+ * Display everything, wrap it in a div for consistent presentation
+ *
+ */
+ public String getAllMessages() {
+ validate();
+ process();
+ if (_errors.size() <= 0 && _notices.size() <= 0)
+ return "";
+ StringBuffer buf = new StringBuffer(512);
+ buf.append("");
+ if (_errors.size() > 0) {
+ buf.append("");
+ buf.append(render(_errors));
+ buf.append("");
+ }
+ if (_notices.size() > 0) {
+ buf.append("");
+ buf.append(render(_notices));
+ buf.append("");
+ }
+ buf.append("
");
+ return buf.toString();
+ }
+
/**
* Display any error messages (processing the form if it hasn't
* been yet)
@@ -85,6 +110,7 @@ public class FormHandler {
*/
public String getErrors() {
validate();
+ process();
return render(_errors);
}
@@ -95,6 +121,7 @@ public class FormHandler {
*/
public String getNotices() {
validate();
+ process();
return render(_notices);
}
@@ -133,28 +160,29 @@ public class FormHandler {
if ( (expected != null) && (expected.trim().length() > 0) && (expected.equals(_passphrase)) ) {
// ok
} else {
- addFormError("Invalid nonce, are you being spoofed?");
+ addFormError("Invalid form submission, probably because you used the 'back' or 'reload' button on your browser. Please resubmit.");
_valid = false;
}
}
}
- private String render(List source) {
+ private void process() {
if (!_processed) {
if (_valid)
processForm();
_processed = true;
}
+ }
+
+ private String render(List source) {
if (source.size() <= 0) {
return "";
- } else if (source.size() == 1) {
- return (String)source.get(0);
} else {
StringBuffer buf = new StringBuffer(512);
buf.append("\n");
for (int i = 0; i < source.size(); i++) {
buf.append("- ");
- buf.append((String)source.get(i));
+ buf.append(source.get(i));
buf.append("
\n");
}
buf.append("
\n");
diff --git a/apps/routerconsole/jsp/config.jsp b/apps/routerconsole/jsp/config.jsp
index 16593f5d0b..3e5d5893fb 100644
--- a/apps/routerconsole/jsp/config.jsp
+++ b/apps/routerconsole/jsp/config.jsp
@@ -18,8 +18,7 @@
" />
-
-
+
UDP Configuration:
UDP port:
diff --git a/apps/routerconsole/jsp/configadvanced.jsp b/apps/routerconsole/jsp/configadvanced.jsp
index bdb64be38e..dbf75ccf15 100644
--- a/apps/routerconsole/jsp/configadvanced.jsp
+++ b/apps/routerconsole/jsp/configadvanced.jsp
@@ -19,8 +19,7 @@
" />
-
-
+