You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by cn...@apache.org on 2016/01/29 13:55:04 UTC

[4/4] struts git commit: updated comments

updated comments


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/2a6acabe
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/2a6acabe
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/2a6acabe

Branch: refs/heads/support-2-3
Commit: 2a6acabe5d53ba01073f8471c56f95ac31087bd3
Parents: 377c6cd
Author: cnenning <cn...@apache.org>
Authored: Thu Jan 28 10:58:44 2016 +0100
Committer: cnenning <cn...@apache.org>
Committed: Fri Jan 29 13:54:31 2016 +0100

----------------------------------------------------------------------
 .../src/main/webapp/WEB-INF/validation/ajaxFormSubmit.jsp     | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/2a6acabe/apps/showcase/src/main/webapp/WEB-INF/validation/ajaxFormSubmit.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/ajaxFormSubmit.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/ajaxFormSubmit.jsp
index c327802..f30403f 100644
--- a/apps/showcase/src/main/webapp/WEB-INF/validation/ajaxFormSubmit.jsp
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/ajaxFormSubmit.jsp
@@ -63,7 +63,7 @@
  *******************************************************************/
 
  /**
-  * Validates given form per AJAX. To be called as onSubmit handler.
+  * Validates form per AJAX. To be called as onSubmit handler.
   *
   * @param event onSubmit event
   */
@@ -141,7 +141,6 @@ function _removeValidationErrors() {
  *
  * @param form Form containing errors.
  * @param errors Errors from server.
- * @returns {Boolean} True if form can be submitted.
  */
 function _handleValidationResult(form, errors) {
     // action errors
@@ -150,7 +149,7 @@ function _handleValidationResult(form, errors) {
         var errorContainer = $('ul.errorMessage');
         $.each(errors.errors, function(index, errorMsg) {
             var li = $('<li><span></span></li>');
-            li.text(errorMsg);
+            li.text(errorMsg); // use text() for security reasons
             errorContainer.append(li);
         });
     }
@@ -161,7 +160,7 @@ function _handleValidationResult(form, errors) {
             var td = $('td[data-error-for-fieldname="' + fieldName + '"]');
             if (td) {
                 var div = $('<div class="errorMessage"></div>');
-                div.text(errorMsg);
+                div.text(errorMsg); // use text() for security reasons
                 td.append(div);
             }
         });