(struts) 01/01: WW-5402 Auto loads Tiles definitions from classpath

2024-03-25 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch feature/WW-5402-autoload-classptah
in repository https://gitbox.apache.org/repos/asf/struts.git

commit bf2d375110aecea885b06d774dc801509709ec1c
Author: Lukasz Lenart 
AuthorDate: Sun Mar 24 11:29:12 2024 +0100

WW-5402 Auto loads Tiles definitions from classpath
---
 plugins/tiles/pom.xml  |   3 -
 .../struts2/tiles/StrutsTilesContainerFactory.java |  25 ++--
 .../tiles/StrutsTilesContainerFactoryTest.java | 126 +
 3 files changed, 144 insertions(+), 10 deletions(-)

diff --git a/plugins/tiles/pom.xml b/plugins/tiles/pom.xml
index 440f6ee79..1a6caf2c1 100644
--- a/plugins/tiles/pom.xml
+++ b/plugins/tiles/pom.xml
@@ -35,9 +35,6 @@
 
 
 build-autotags
-
-true
-
 
 
 
diff --git 
a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
 
b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
index 205476467..d1b1a4f52 100644
--- 
a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
+++ 
b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
@@ -25,11 +25,6 @@ import ognl.PropertyAccessor;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.tiles.api.TilesContainer;
-import org.apache.tiles.request.ApplicationContext;
-import org.apache.tiles.request.ApplicationResource;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.render.BasicRendererFactory;
-import org.apache.tiles.request.render.ChainedDelegateRenderer;
 import org.apache.tiles.core.definition.DefinitionsFactory;
 import 
org.apache.tiles.core.definition.pattern.DefinitionPatternMatcherFactory;
 import org.apache.tiles.core.definition.pattern.PatternDefinitionResolver;
@@ -57,6 +52,11 @@ import org.apache.tiles.ognl.PropertyAccessorDelegateFactory;
 import org.apache.tiles.ognl.ScopePropertyAccessor;
 import org.apache.tiles.ognl.TilesApplicationContextNestedObjectExtractor;
 import org.apache.tiles.ognl.TilesContextPropertyAccessorDelegateFactory;
+import org.apache.tiles.request.ApplicationContext;
+import org.apache.tiles.request.ApplicationResource;
+import org.apache.tiles.request.Request;
+import org.apache.tiles.request.render.BasicRendererFactory;
+import org.apache.tiles.request.render.ChainedDelegateRenderer;
 import org.apache.tiles.request.render.Renderer;
 
 import javax.el.ArrayELResolver;
@@ -69,6 +69,7 @@ import javax.el.ResourceBundleELResolver;
 import javax.servlet.jsp.JspFactory;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -100,10 +101,20 @@ public class StrutsTilesContainerFactory extends 
BasicTilesContainerFactory {
 public static final String PATTERN_WILDCARD = "WILDCARD";
 public static final String PATTERN_REGEXP = "REGEXP";
 
+/**
+ * Default pattern to be used to collect Tiles definitions if user didn't 
configure any
+ * @deprecated since Struts 6.4.0, use {@link #TILES_DEFAULT_PATTERNS} 
instead
+ */
+@Deprecated
+public static final String TILES_DEFAULT_PATTERN = 
"/WEB-INF/**/tiles*.xml,classpath*:META-INF/**/tiles*.xml";
+
 /**
  * Default pattern to be used to collect Tiles definitions if user didn't 
configure any
  */
-public static final String TILES_DEFAULT_PATTERN = "tiles*.xml";
+public static final Set TILES_DEFAULT_PATTERNS = new 
HashSet() {{
+add("/WEB-INF/**/tiles*.xml");
+add("classpath*:META-INF/**/tiles*.xml");
+}};
 
 /**
  * Supported expression languages
@@ -213,7 +224,7 @@ public class StrutsTilesContainerFactory extends 
BasicTilesContainerFactory {
 if (params.containsKey(DefinitionsFactory.DEFINITIONS_CONFIG)) {
 return 
TextParseUtil.commaDelimitedStringToSet(params.get(DefinitionsFactory.DEFINITIONS_CONFIG));
 }
-return TextParseUtil.commaDelimitedStringToSet(TILES_DEFAULT_PATTERN);
+return TILES_DEFAULT_PATTERNS;
 }
 
 protected ELAttributeEvaluator createELEvaluator(ApplicationContext 
applicationContext) {
diff --git 
a/plugins/tiles/src/test/java/org/apache/struts2/tiles/StrutsTilesContainerFactoryTest.java
 
b/plugins/tiles/src/test/java/org/apache/struts2/tiles/StrutsTilesContainerFactoryTest.java
new file mode 100644
index 0..0ae0eb7c5
--- /dev/null
+++ 
b/plugins/tiles/src/test/java/org/apache/struts2/tiles/StrutsTilesContainerFactoryTest.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * rega

(struts) branch feature/WW-5402-autoload-classptah updated (7c69765dd -> bf2d37511)

2024-03-25 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch feature/WW-5402-autoload-classptah
in repository https://gitbox.apache.org/repos/asf/struts.git


 discard 7c69765dd WW-5402 Auto loads Tiles definitions from classpath
 new bf2d37511 WW-5402 Auto loads Tiles definitions from classpath

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (7c69765dd)
\
 N -- N -- N   refs/heads/feature/WW-5402-autoload-classptah 
(bf2d37511)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../tiles/StrutsTilesContainerFactoryTest.java | 62 ++
 1 file changed, 27 insertions(+), 35 deletions(-)



(struts) 01/01: WW-5402 Auto loads Tiles definitions from classpath

2024-03-25 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch feature/WW-5402-autoload-classptah
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 885c9a51e883e07b5e6f857d64f225695bb6a778
Author: Lukasz Lenart 
AuthorDate: Sun Mar 24 11:29:12 2024 +0100

WW-5402 Auto loads Tiles definitions from classpath
---
 plugins/tiles/pom.xml  |   3 -
 .../struts2/tiles/StrutsTilesContainerFactory.java |  25 ++--
 .../tiles/StrutsTilesContainerFactoryTest.java | 128 +
 3 files changed, 146 insertions(+), 10 deletions(-)

diff --git a/plugins/tiles/pom.xml b/plugins/tiles/pom.xml
index 440f6ee79..1a6caf2c1 100644
--- a/plugins/tiles/pom.xml
+++ b/plugins/tiles/pom.xml
@@ -35,9 +35,6 @@
 
 
 build-autotags
-
-true
-
 
 
 
diff --git 
a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
 
b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
index 205476467..d1b1a4f52 100644
--- 
a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
+++ 
b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
@@ -25,11 +25,6 @@ import ognl.PropertyAccessor;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.tiles.api.TilesContainer;
-import org.apache.tiles.request.ApplicationContext;
-import org.apache.tiles.request.ApplicationResource;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.render.BasicRendererFactory;
-import org.apache.tiles.request.render.ChainedDelegateRenderer;
 import org.apache.tiles.core.definition.DefinitionsFactory;
 import 
org.apache.tiles.core.definition.pattern.DefinitionPatternMatcherFactory;
 import org.apache.tiles.core.definition.pattern.PatternDefinitionResolver;
@@ -57,6 +52,11 @@ import org.apache.tiles.ognl.PropertyAccessorDelegateFactory;
 import org.apache.tiles.ognl.ScopePropertyAccessor;
 import org.apache.tiles.ognl.TilesApplicationContextNestedObjectExtractor;
 import org.apache.tiles.ognl.TilesContextPropertyAccessorDelegateFactory;
+import org.apache.tiles.request.ApplicationContext;
+import org.apache.tiles.request.ApplicationResource;
+import org.apache.tiles.request.Request;
+import org.apache.tiles.request.render.BasicRendererFactory;
+import org.apache.tiles.request.render.ChainedDelegateRenderer;
 import org.apache.tiles.request.render.Renderer;
 
 import javax.el.ArrayELResolver;
@@ -69,6 +69,7 @@ import javax.el.ResourceBundleELResolver;
 import javax.servlet.jsp.JspFactory;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -100,10 +101,20 @@ public class StrutsTilesContainerFactory extends 
BasicTilesContainerFactory {
 public static final String PATTERN_WILDCARD = "WILDCARD";
 public static final String PATTERN_REGEXP = "REGEXP";
 
+/**
+ * Default pattern to be used to collect Tiles definitions if user didn't 
configure any
+ * @deprecated since Struts 6.4.0, use {@link #TILES_DEFAULT_PATTERNS} 
instead
+ */
+@Deprecated
+public static final String TILES_DEFAULT_PATTERN = 
"/WEB-INF/**/tiles*.xml,classpath*:META-INF/**/tiles*.xml";
+
 /**
  * Default pattern to be used to collect Tiles definitions if user didn't 
configure any
  */
-public static final String TILES_DEFAULT_PATTERN = "tiles*.xml";
+public static final Set TILES_DEFAULT_PATTERNS = new 
HashSet() {{
+add("/WEB-INF/**/tiles*.xml");
+add("classpath*:META-INF/**/tiles*.xml");
+}};
 
 /**
  * Supported expression languages
@@ -213,7 +224,7 @@ public class StrutsTilesContainerFactory extends 
BasicTilesContainerFactory {
 if (params.containsKey(DefinitionsFactory.DEFINITIONS_CONFIG)) {
 return 
TextParseUtil.commaDelimitedStringToSet(params.get(DefinitionsFactory.DEFINITIONS_CONFIG));
 }
-return TextParseUtil.commaDelimitedStringToSet(TILES_DEFAULT_PATTERN);
+return TILES_DEFAULT_PATTERNS;
 }
 
 protected ELAttributeEvaluator createELEvaluator(ApplicationContext 
applicationContext) {
diff --git 
a/plugins/tiles/src/test/java/org/apache/struts2/tiles/StrutsTilesContainerFactoryTest.java
 
b/plugins/tiles/src/test/java/org/apache/struts2/tiles/StrutsTilesContainerFactoryTest.java
new file mode 100644
index 0..122bfe51d
--- /dev/null
+++ 
b/plugins/tiles/src/test/java/org/apache/struts2/tiles/StrutsTilesContainerFactoryTest.java
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * rega

(struts) branch feature/WW-5402-autoload-classptah updated (bf2d37511 -> 885c9a51e)

2024-03-25 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch feature/WW-5402-autoload-classptah
in repository https://gitbox.apache.org/repos/asf/struts.git


 discard bf2d37511 WW-5402 Auto loads Tiles definitions from classpath
 new 885c9a51e WW-5402 Auto loads Tiles definitions from classpath

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (bf2d37511)
\
 N -- N -- N   refs/heads/feature/WW-5402-autoload-classptah 
(885c9a51e)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../struts2/tiles/StrutsTilesContainerFactoryTest.java   | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)



(struts-site) 01/01: Merge pull request #232 from apache/fix/file-upload-navigation

2024-03-25 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/struts-site.git

commit 675562186a3112e4bf7ae5393fb2d102807fc814
Merge: 440ac19bf bb53f2be5
Author: Lukasz Lenart 
AuthorDate: Mon Mar 25 10:12:15 2024 +0100

Merge pull request #232 from apache/fix/file-upload-navigation

Splits file upload page

 .gitignore |   3 +-
 Gemfile.lock   |  70 -
 _config.yml|   4 +-
 docker-arm64-serve.sh  |   3 +
 source/_layouts/default.html   |   2 +-
 .../action-file-upload-interceptor.md  |  11 +-
 .../{file-upload.md => action-file-upload.md}  | 202 +++-
 source/core-developers/file-upload-interceptor.md  |   9 +-
 source/core-developers/file-upload.md  |  52 +---
 source/core-developers/interceptors.md |  82 ++---
 source/css/main.css|   2 -
 source/css/syntax.css  | 273 +
 source/highlighter/github-theme.css|  60 
 source/highlighter/js/shAutoloader.js  |  17 --
 source/highlighter/js/shBrushAS3.js|  59 
 source/highlighter/js/shBrushAppleScript.js|  75 -
 source/highlighter/js/shBrushBash.js   |  59 
 source/highlighter/js/shBrushCSharp.js |  65 
 source/highlighter/js/shBrushColdFusion.js | 100 --
 source/highlighter/js/shBrushCpp.js|  97 --
 source/highlighter/js/shBrushCss.js|  91 --
 source/highlighter/js/shBrushDelphi.js |  55 
 source/highlighter/js/shBrushDiff.js   |  41 ---
 source/highlighter/js/shBrushErlang.js |  52 
 source/highlighter/js/shBrushGroovy.js |  67 
 source/highlighter/js/shBrushJScript.js|  52 
 source/highlighter/js/shBrushJava.js   |  57 
 source/highlighter/js/shBrushJavaFX.js |  58 
 source/highlighter/js/shBrushPerl.js   |  72 -
 source/highlighter/js/shBrushPhp.js|  88 --
 source/highlighter/js/shBrushPlain.js  |  33 --
 source/highlighter/js/shBrushPowerShell.js |  74 -
 source/highlighter/js/shBrushPython.js |  64 
 source/highlighter/js/shBrushRuby.js   |  55 
 source/highlighter/js/shBrushSass.js   |  94 --
 source/highlighter/js/shBrushScala.js  |  51 
 source/highlighter/js/shBrushSql.js|  66 
 source/highlighter/js/shBrushVb.js |  56 
 source/highlighter/js/shBrushXml.js|  69 -
 source/highlighter/js/shCore.js|  17 --
 source/highlighter/js/shLegacy.js  |  17 --
 source/highlighter/style/shCore.css| 226 --
 source/highlighter/style/shCoreDefault.css | 328 
 source/highlighter/style/shCoreDjango.css  | 331 
 source/highlighter/style/shCoreEclipse.css | 339 -
 source/highlighter/style/shCoreEmacs.css   | 324 
 source/highlighter/style/shCoreFadeToGrey.css  | 328 
 source/highlighter/style/shCoreMDUltra.css | 324 
 source/highlighter/style/shCoreMidnight.css| 324 
 source/highlighter/style/shCoreRDark.css   | 324 
 source/highlighter/style/shCoreStruts.css  | 339 -
 source/highlighter/style/shThemeDefault.css| 117 ---
 source/highlighter/style/shThemeDjango.css | 120 
 source/highlighter/style/shThemeEclipse.css| 128 
 source/highlighter/style/shThemeEmacs.css  | 113 ---
 source/highlighter/style/shThemeFadeToGrey.css | 117 ---
 source/highlighter/style/shThemeMDUltra.css| 113 ---
 source/highlighter/style/shThemeMidnight.css   | 113 ---
 source/highlighter/style/shThemeRDark.css  | 113 ---
 source/highlighter/style/shThemeStruts.css | 128 
 source/mail.md |   6 +-
 source/updating-website.md | 199 
 62 files changed, 527 insertions(+), 6401 deletions(-)



(struts-site) branch fix/file-upload-navigation deleted (was bb53f2be5)

2024-03-25 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch fix/file-upload-navigation
in repository https://gitbox.apache.org/repos/asf/struts-site.git


 was bb53f2be5 Adds example with supporting multiple file uploads

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(struts-site) branch master updated (440ac19bf -> 675562186)

2024-03-25 Thread lukaszlenart
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/struts-site.git


from 440ac19bf Merge pull request #231 from 
apache/fix/file-upload-navigation
 add 812ca70f7 Splits file upload page
 add b537ecaa0 Drops useless highlighter
 add 471ce2b5e Adds dedicate examples with different styles
 add 5cc6d2313 Improves style
 add bb53f2be5 Adds example with supporting multiple file uploads
 new 675562186 Merge pull request #232 from 
apache/fix/file-upload-navigation

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitignore |   3 +-
 Gemfile.lock   |  70 -
 _config.yml|   4 +-
 docker-arm64-serve.sh  |   3 +
 source/_layouts/default.html   |   2 +-
 .../action-file-upload-interceptor.md  |  11 +-
 .../{file-upload.md => action-file-upload.md}  | 202 +++-
 source/core-developers/file-upload-interceptor.md  |   9 +-
 source/core-developers/file-upload.md  |  52 +---
 source/core-developers/interceptors.md |  82 ++---
 source/css/main.css|   2 -
 source/css/syntax.css  | 273 +
 source/highlighter/github-theme.css|  60 
 source/highlighter/js/shAutoloader.js  |  17 --
 source/highlighter/js/shBrushAS3.js|  59 
 source/highlighter/js/shBrushAppleScript.js|  75 -
 source/highlighter/js/shBrushBash.js   |  59 
 source/highlighter/js/shBrushCSharp.js |  65 
 source/highlighter/js/shBrushColdFusion.js | 100 --
 source/highlighter/js/shBrushCpp.js|  97 --
 source/highlighter/js/shBrushCss.js|  91 --
 source/highlighter/js/shBrushDelphi.js |  55 
 source/highlighter/js/shBrushDiff.js   |  41 ---
 source/highlighter/js/shBrushErlang.js |  52 
 source/highlighter/js/shBrushGroovy.js |  67 
 source/highlighter/js/shBrushJScript.js|  52 
 source/highlighter/js/shBrushJava.js   |  57 
 source/highlighter/js/shBrushJavaFX.js |  58 
 source/highlighter/js/shBrushPerl.js   |  72 -
 source/highlighter/js/shBrushPhp.js|  88 --
 source/highlighter/js/shBrushPlain.js  |  33 --
 source/highlighter/js/shBrushPowerShell.js |  74 -
 source/highlighter/js/shBrushPython.js |  64 
 source/highlighter/js/shBrushRuby.js   |  55 
 source/highlighter/js/shBrushSass.js   |  94 --
 source/highlighter/js/shBrushScala.js  |  51 
 source/highlighter/js/shBrushSql.js|  66 
 source/highlighter/js/shBrushVb.js |  56 
 source/highlighter/js/shBrushXml.js|  69 -
 source/highlighter/js/shCore.js|  17 --
 source/highlighter/js/shLegacy.js  |  17 --
 source/highlighter/style/shCore.css| 226 --
 source/highlighter/style/shCoreDefault.css | 328 
 source/highlighter/style/shCoreDjango.css  | 331 
 source/highlighter/style/shCoreEclipse.css | 339 -
 source/highlighter/style/shCoreEmacs.css   | 324 
 source/highlighter/style/shCoreFadeToGrey.css  | 328 
 source/highlighter/style/shCoreMDUltra.css | 324 
 source/highlighter/style/shCoreMidnight.css| 324 
 source/highlighter/style/shCoreRDark.css   | 324 
 source/highlighter/style/shCoreStruts.css  | 339 -
 source/highlighter/style/shThemeDefault.css| 117 ---
 source/highlighter/style/shThemeDjango.css | 120 
 source/highlighter/style/shThemeEclipse.css| 128 
 source/highlighter/style/shThemeEmacs.css  | 113 ---
 source/highlighter/style/shThemeFadeToGrey.css | 117 ---
 source/highlighter/style/shThemeMDUltra.css| 113 ---
 source/highlighter/style/shThemeMidnight.css   | 113 ---
 source/highlighter/style/shThemeRDark.css  | 113 ---
 source/highlighter/style/shThemeStruts.css | 128 
 source/mail.md |   6 +-
 source/updating-website.md | 199 
 62 files changed, 527 insertio

(struts-site) branch asf-staging updated: Updates stage by Jenkins

2024-03-25 Thread git-site-role
This is an automated email from the ASF dual-hosted git repository.

git-site-role pushed a commit to branch asf-staging
in repository https://gitbox.apache.org/repos/asf/struts-site.git


The following commit(s) were added to refs/heads/asf-staging by this push:
 new 7a5a86c79 Updates stage by Jenkins
7a5a86c79 is described below

commit 7a5a86c79595b2b262cd622d33bd7c19822b3609
Author: jenkins 
AuthorDate: Mon Mar 25 09:15:42 2024 +

Updates stage by Jenkins
---
 .../ajax-client-side-validation.html   | 84 ++---
 content/plugins/json/index.html| 12 +--
 content/plugins/json/json-ajax-validation.html | 86 +++---
 .../ajax-and-javascript-recipes.html   | 78 ++--
 content/tag-developers/ajax-div-template.html  | 12 +--
 content/tag-developers/ajax-event-system.html  |  4 +-
 6 files changed, 138 insertions(+), 138 deletions(-)

diff --git a/content/core-developers/ajax-client-side-validation.html 
b/content/core-developers/ajax-client-side-validation.html
index 396dfbea1..9570c2e5f 100644
--- a/content/core-developers/ajax-client-side-validation.html
+++ b/content/core-developers/ajax-client-side-validation.html
@@ -509,21 +509,21 @@ It takes care of hiding validation errors that might be 
present, submit the form
   *
   * @param event onSubmit event
   */
-function ajaxFormValidation(event) {
-event.preventDefault();
-_removeValidationErrors();
-var _form = $(event.target);
-var _formData = _form.serialize(true);
+function ajaxFormValidation(event) {
+event.preventDefault();
+_removeValidationErrors();
+var _form = $(event.target);
+var _formData = _form.serialize(true);
 // prepare visual feedback
 // you may want to use other elements here
-var originalButton = _form.find('.btn-primary');
+var originalButton = _form.find('.btn-primary');
 // note: jQuery returns an array-like object
-if (originalButton && originalButton.length && originalButton.length > 0) {
-originalButton.hide();
-var feedbackElement 
= $('
').insertAfter(originalButton); +if (originalButton && originalButton.length && originalButton.length > 0) { +originalButton.hide(); +var feedbackElement = $('
').insertAfter(originalButton); var restoreFunction = function() { -originalButton.show(); -feedbackElement.remove(); +originalButton.show(); +feedbackElement.remove(); } } var options = { @@ -531,48 +531,48 @@ It takes care of hiding validation errors that might be present, submit the form async: true, processData: false, type: 'POST', -success: function (response, statusText, xhr) { -if (response.location) { +success: function (response, statusText, xhr) { +if (response.location) { // no validation errors // action has been executed and sent a redirect URL wrapped as JSON // cannot use a normal http-redirect (status-code 3xx) as this would be followed by browsers and would not be available here // follow JSON-redirect window.location.href = response.location; } else { -if (restoreFunction) { -restoreFunction(); +if (restoreFunction) { +restoreFunction(); } -_handleValidationResult(_form, response); +_handleValidationResult(_form, response); } }, error: function(xhr, textStatus, errorThrown) { -if (restoreFunction) { -restoreFunction(); +if (restoreFunction) { +restoreFunction(); } // struts sends status code 400 when validation errors are present -if (xhr.status === 400) { -_handleValidationResult(_form, JSON.parse(xhr.responseText)) +if (xhr.status === 400) { +_handleValidationResult(_form, JSON.parse(xhr.responseText)) } else { // a real error occurred -> show user an error message -_handleValidationResult(_form, {errors: ['Network or server error!']}) +_handleValidationResult(_form, {errors: ['Network or server error!']}) } } } // send request, after delay to make sure everybody notices the visual feedback :) -window.setTimeout(function() { +window.setTimeout(function() { var url = _form[0].action; -jQuery.ajax(url, options); +jQuery.ajax(url, options); }, 1000); } /** * Removes validation errors from HTML DOM. */ -function _removeValidationErrors() { +function _removeValidationErrors()