struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cnenn...@apache.org
Subject struts git commit: updated comments
Date Thu, 28 Jan 2016 09:59:08 GMT
Repository: struts
Updated Branches:
  refs/heads/master 6fb870d38 -> d0baa7060


updated comments


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

Branch: refs/heads/master
Commit: d0baa7060dd502b8a2eadb3916623461a7099f51
Parents: 6fb870d
Author: cnenning <cnenning@apache.org>
Authored: Thu Jan 28 10:58:44 2016 +0100
Committer: cnenning <cnenning@apache.org>
Committed: Thu Jan 28 10:58:44 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/d0baa706/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);
             }
         });


Mime
View raw message