(struts) 01/01: WW-5419 Fixes support for loading Tiles definitions

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

lukaszlenart pushed a commit to branch fix/WW-5419-tiles
in repository https://gitbox.apache.org/repos/asf/struts.git

commit e8caaac10e8686b5cd1b38d08e18d143fb247ef7
Author: Lukasz Lenart 
AuthorDate: Sun Apr 21 10:21:55 2024 +0200

WW-5419 Fixes support for loading Tiles definitions
---
 plugins/tiles/pom.xml  | 10 +++
 .../struts2/tiles/StrutsTilesContainerFactory.java | 16 ++---
 .../StrutsWildcardServletApplicationContext.java   |  9 ++-
 .../tiles/StrutsTilesContainerFactoryTest.java |  9 ++-
 ...trutsWildcardServletApplicationContextTest.java | 79 ++
 plugins/tiles/src/test/resources/WEB-INF/tiles.xml | 39 +++
 .../org/apache/tiles/core/config/tiles_defs1.xml   | 75 
 7 files changed, 218 insertions(+), 19 deletions(-)

diff --git a/plugins/tiles/pom.xml b/plugins/tiles/pom.xml
index 618bc6a8c..53d79b89d 100644
--- a/plugins/tiles/pom.xml
+++ b/plugins/tiles/pom.xml
@@ -102,6 +102,16 @@
 log4j-jcl
 test
 
+
+org.assertj
+assertj-core
+test
+
+
+org.springframework
+spring-test
+test
+
 
 
 UTF-8
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 ed03f8268..14d807b6b 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
@@ -68,7 +68,6 @@ import javax.el.MapELResolver;
 import javax.el.ResourceBundleELResolver;
 import javax.servlet.jsp.JspFactory;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
@@ -105,19 +104,18 @@ public class StrutsTilesContainerFactory extends 
BasicTilesContainerFactory {
 
 /**
  * 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";
+public static final Set TILES_DEFAULT_PATTERNS = 
Collections.unmodifiableSet(new HashSet<>(Collections.singletonList(
+"*tiles*.xml"
+)));
 
 /**
  * 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
  */
-public static final Set TILES_DEFAULT_PATTERNS = 
Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
-"/WEB-INF/**/tiles*.xml",
-"classpath*:META-INF/**/tiles*.xml"
-)));
+@Deprecated
+public static final String TILES_DEFAULT_PATTERN = String.join(",", 
TILES_DEFAULT_PATTERNS);
 
 /**
  * Supported expression languages
diff --git 
a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java
 
b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java
index 7af6069bb..2a30eb626 100644
--- 
a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java
+++ 
b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java
@@ -43,7 +43,7 @@ public class StrutsWildcardServletApplicationContext extends 
ServletApplicationC
 
 private static final Logger LOG = 
LogManager.getLogger(StrutsWildcardServletApplicationContext.class);
 
-private ResourceFinder finder;
+private final ResourceFinder finder;
 
 public StrutsWildcardServletApplicationContext(ServletContext context) {
 super(context);
@@ -64,16 +64,15 @@ public class StrutsWildcardServletApplicationContext 
extends ServletApplicationC
 }
 
 try {
-Enumeration resources = 
getClass().getClassLoader().getResources("/");
+Enumeration resources = 
getClass().getClassLoader().getResources("");
 while (resources.hasMoreElements()) {
-URL resource = resources.nextElement();
-urls.add(resource);
+urls.add(resources.nextElement());
 }
 } catch (IOException e) {
 throw new ConfigurationException(e);
 }
 
-finder = new ResourceFinder(urls.toArray(new URL[urls.size()]));
+finder = new ResourceFinder(urls.toArray(new URL[0]));
 }
 
 public Collection getResources(String path) {
diff --git 
a/plugins/tiles/src/test/java/org/apache/struts2/tiles/StrutsTilesContainerFactoryTest.java
 
b/plugins/tiles/src/test/java/org/apache

(struts) branch fix/WW-5419-tiles created (now e8caaac10)

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

lukaszlenart pushed a change to branch fix/WW-5419-tiles
in repository https://gitbox.apache.org/repos/asf/struts.git


  at e8caaac10 WW-5419 Fixes support for loading Tiles definitions

This branch includes the following new commits:

 new e8caaac10 WW-5419 Fixes support for loading Tiles definitions

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.




(struts) branch fix/sonar created (now 5883c2ea5)

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

lukaszlenart pushed a change to branch fix/sonar
in repository https://gitbox.apache.org/repos/asf/struts.git


  at 5883c2ea5 Always run Sonar scan against the master branch

This branch includes the following new commits:

 new 5883c2ea5 Always run Sonar scan against the master branch

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.




(struts) 01/01: Always run Sonar scan against the master branch

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

lukaszlenart pushed a commit to branch fix/sonar
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 5883c2ea5e8d0cffb36b878c8e48432bbbdc4acb
Author: Lukasz Lenart 
AuthorDate: Sun Apr 21 13:44:32 2024 +0200

Always run Sonar scan against the master branch
---
 .github/workflows/sonar.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml
index 4a3667e4c..f8434e021 100644
--- a/.github/workflows/sonar.yml
+++ b/.github/workflows/sonar.yml
@@ -44,4 +44,4 @@ jobs:
   - env:
   GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
-run: mvn -B -V -Pcoverage -DskipAssembly verify 
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar --no-transfer-progress
+run: ./mvnw verify sonar:sonar -Dsonar.branch.name=master -Pcoverage 
-DskipAssembly --no-transfer-progress



(struts) 01/01: WW-5419 Fixes support for loading Tiles definitions

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

lukaszlenart pushed a commit to branch fix/WW-5419-tiles
in repository https://gitbox.apache.org/repos/asf/struts.git

commit b174f3ecf0a0d7b4d535d71d9df699191fd17675
Author: Lukasz Lenart 
AuthorDate: Sun Apr 21 10:21:55 2024 +0200

WW-5419 Fixes support for loading Tiles definitions
---
 plugins/tiles/pom.xml  | 10 +++
 .../struts2/tiles/StrutsTilesContainerFactory.java | 18 +
 .../StrutsWildcardServletApplicationContext.java   |  9 ++-
 .../tiles/StrutsTilesContainerFactoryTest.java |  9 ++-
 ...trutsWildcardServletApplicationContextTest.java | 79 ++
 plugins/tiles/src/test/resources/WEB-INF/tiles.xml | 39 +++
 .../org/apache/tiles/core/config/tiles_defs1.xml   | 75 
 7 files changed, 213 insertions(+), 26 deletions(-)

diff --git a/plugins/tiles/pom.xml b/plugins/tiles/pom.xml
index 618bc6a8c..53d79b89d 100644
--- a/plugins/tiles/pom.xml
+++ b/plugins/tiles/pom.xml
@@ -102,6 +102,16 @@
 log4j-jcl
 test
 
+
+org.assertj
+assertj-core
+test
+
+
+org.springframework
+spring-test
+test
+
 
 
 UTF-8
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 ed03f8268..21bbbf97e 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
@@ -68,10 +68,7 @@ import javax.el.MapELResolver;
 import javax.el.ResourceBundleELResolver;
 import javax.servlet.jsp.JspFactory;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -105,19 +102,8 @@ public class StrutsTilesContainerFactory extends 
BasicTilesContainerFactory {
 
 /**
  * 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 Set TILES_DEFAULT_PATTERNS = 
Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
-"/WEB-INF/**/tiles*.xml",
-"classpath*:META-INF/**/tiles*.xml"
-)));
+public static final String TILES_DEFAULT_PATTERN = "*tiles*.xml";
 
 /**
  * Supported expression languages
@@ -227,7 +213,7 @@ public class StrutsTilesContainerFactory extends 
BasicTilesContainerFactory {
 if (params.containsKey(DefinitionsFactory.DEFINITIONS_CONFIG)) {
 return 
TextParseUtil.commaDelimitedStringToSet(params.get(DefinitionsFactory.DEFINITIONS_CONFIG));
 }
-return TILES_DEFAULT_PATTERNS;
+return TextParseUtil.commaDelimitedStringToSet(TILES_DEFAULT_PATTERN);
 }
 
 protected ELAttributeEvaluator createELEvaluator(ApplicationContext 
applicationContext) {
diff --git 
a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java
 
b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java
index 7af6069bb..2a30eb626 100644
--- 
a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java
+++ 
b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java
@@ -43,7 +43,7 @@ public class StrutsWildcardServletApplicationContext extends 
ServletApplicationC
 
 private static final Logger LOG = 
LogManager.getLogger(StrutsWildcardServletApplicationContext.class);
 
-private ResourceFinder finder;
+private final ResourceFinder finder;
 
 public StrutsWildcardServletApplicationContext(ServletContext context) {
 super(context);
@@ -64,16 +64,15 @@ public class StrutsWildcardServletApplicationContext 
extends ServletApplicationC
 }
 
 try {
-Enumeration resources = 
getClass().getClassLoader().getResources("/");
+Enumeration resources = 
getClass().getClassLoader().getResources("");
 while (resources.hasMoreElements()) {
-URL resource = resources.nextElement();
-urls.add(resource);
+urls.add(resources.nextElement());
 }
 } catch (IOException e) {
 throw new ConfigurationException(e);
 }
 
-finder = new ResourceFinder(urls.toArra

(struts) branch fix/WW-5419-tiles updated (e8caaac10 -> b174f3ecf)

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

lukaszlenart pushed a change to branch fix/WW-5419-tiles
in repository https://gitbox.apache.org/repos/asf/struts.git


 discard e8caaac10 WW-5419 Fixes support for loading Tiles definitions
 new b174f3ecf WW-5419 Fixes support for loading Tiles definitions

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   (e8caaac10)
\
 N -- N -- N   refs/heads/fix/WW-5419-tiles (b174f3ecf)

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/StrutsTilesContainerFactory.java   | 16 ++--
 1 file changed, 2 insertions(+), 14 deletions(-)



(struts) branch fix/sonar updated (5883c2ea5 -> 47215ba42)

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

lukaszlenart pushed a change to branch fix/sonar
in repository https://gitbox.apache.org/repos/asf/struts.git


 discard 5883c2ea5 Always run Sonar scan against the master branch
 new 47215ba42 Always run Sonar scan against the master branch

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   (5883c2ea5)
\
 N -- N -- N   refs/heads/fix/sonar (47215ba42)

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:
 .github/workflows/sonar.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



(struts) 01/01: Always run Sonar scan against the master branch

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

lukaszlenart pushed a commit to branch fix/sonar
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 47215ba42877da0966c5fb1bc180aa5c91a4c749
Author: Lukasz Lenart 
AuthorDate: Sun Apr 21 13:44:32 2024 +0200

Always run Sonar scan against the master branch
---
 .github/workflows/sonar.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml
index 4a3667e4c..acbde6ab2 100644
--- a/.github/workflows/sonar.yml
+++ b/.github/workflows/sonar.yml
@@ -44,4 +44,4 @@ jobs:
   - env:
   GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
   SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
-run: mvn -B -V -Pcoverage -DskipAssembly verify 
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar --no-transfer-progress
+run: ./mvnw verify 
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar 
-Dsonar.branch.name=master -Pcoverage -DskipAssembly --no-transfer-progress



(struts-examples) branch dependabot/github_actions/actions/checkout-4.1.3 created (now 23ca4c4)

2024-04-21 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/github_actions/actions/checkout-4.1.3
in repository https://gitbox.apache.org/repos/asf/struts-examples.git


  at 23ca4c4  Bump actions/checkout from 4.1.1 to 4.1.3

No new revisions were added by this update.



(struts-examples) branch dependabot/github_actions/actions/checkout-4.1.2 deleted (was bd99a14)

2024-04-21 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/github_actions/actions/checkout-4.1.2
in repository https://gitbox.apache.org/repos/asf/struts-examples.git


 was bd99a14  Bump actions/checkout from 4.1.1 to 4.1.2

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-examples) branch dependabot/maven/io.quarkus-quarkus-universe-bom-3.9.4 created (now 30f7d7f)

2024-04-21 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/maven/io.quarkus-quarkus-universe-bom-3.9.4
in repository https://gitbox.apache.org/repos/asf/struts-examples.git


  at 30f7d7f  Bump io.quarkus:quarkus-universe-bom from 3.7.3 to 3.9.4

No new revisions were added by this update.



(struts-examples) branch dependabot/maven/io.quarkus-quarkus-universe-bom-3.9.3 deleted (was 0d087cc)

2024-04-21 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/maven/io.quarkus-quarkus-universe-bom-3.9.3
in repository https://gitbox.apache.org/repos/asf/struts-examples.git


 was 0d087cc  Bump io.quarkus:quarkus-universe-bom from 3.7.3 to 3.9.3

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) branch dependabot/maven/org.codehaus.mojo-versions-maven-plugin-2.16.2 created (now b2b35f066)

2024-04-21 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/maven/org.codehaus.mojo-versions-maven-plugin-2.16.2
in repository https://gitbox.apache.org/repos/asf/struts.git


  at b2b35f066 Bump org.codehaus.mojo:versions-maven-plugin from 2.16.1 to 
2.16.2

No new revisions were added by this update.



(struts) branch dependabot/github_actions/actions/upload-artifact-4.3.2 created (now 856d98010)

2024-04-21 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch 
dependabot/github_actions/actions/upload-artifact-4.3.2
in repository https://gitbox.apache.org/repos/asf/struts.git


  at 856d98010 Bump actions/upload-artifact from 4.3.1 to 4.3.2

No new revisions were added by this update.



(struts) branch dependabot/github_actions/actions/upload-artifact-4.3.2 deleted (was 856d98010)

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

lukaszlenart pushed a change to branch 
dependabot/github_actions/actions/upload-artifact-4.3.2
in repository https://gitbox.apache.org/repos/asf/struts.git


 was 856d98010 Bump actions/upload-artifact from 4.3.1 to 4.3.2

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) branch master updated (efdaf7e50 -> eca5b2108)

2024-04-21 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.git


from efdaf7e50 Merge pull request #909 from 
apache/dependabot/maven/org.assertj-assertj-core-3.25.3
 add 856d98010 Bump actions/upload-artifact from 4.3.1 to 4.3.2
 new eca5b2108 Merge pull request #923 from 
apache/dependabot/github_actions/actions/upload-artifact-4.3.2

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:
 .github/workflows/scorecards-analysis.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



(struts) 01/01: Merge pull request #923 from apache/dependabot/github_actions/actions/upload-artifact-4.3.2

2024-04-21 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.git

commit eca5b210888f42ea73d437c104f2f2a0604c42cb
Merge: efdaf7e50 856d98010
Author: Lukasz Lenart 
AuthorDate: Mon Apr 22 06:36:59 2024 +0200

Merge pull request #923 from 
apache/dependabot/github_actions/actions/upload-artifact-4.3.2

Bump actions/upload-artifact from 4.3.1 to 4.3.2

 .github/workflows/scorecards-analysis.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



(struts) branch master updated (eca5b2108 -> 3cde66859)

2024-04-21 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.git


from eca5b2108 Merge pull request #923 from 
apache/dependabot/github_actions/actions/upload-artifact-4.3.2
 add b2b35f066 Bump org.codehaus.mojo:versions-maven-plugin from 2.16.1 to 
2.16.2
 add 3cde66859 Merge pull request #922 from 
apache/dependabot/maven/org.codehaus.mojo-versions-maven-plugin-2.16.2

No new revisions were added by this update.

Summary of changes:
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



(struts) branch dependabot/maven/org.codehaus.mojo-versions-maven-plugin-2.16.2 deleted (was b2b35f066)

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

lukaszlenart pushed a change to branch 
dependabot/maven/org.codehaus.mojo-versions-maven-plugin-2.16.2
in repository https://gitbox.apache.org/repos/asf/struts.git


 was b2b35f066 Bump org.codehaus.mojo:versions-maven-plugin from 2.16.1 to 
2.16.2

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) branch fix/WW-5419-tiles updated (b174f3ecf -> a88cb741d)

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

lukaszlenart pushed a change to branch fix/WW-5419-tiles
in repository https://gitbox.apache.org/repos/asf/struts.git


omit b174f3ecf WW-5419 Fixes support for loading Tiles definitions
 new a88cb741d WW-5419 Fixes support for loading Tiles definitions

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   (b174f3ecf)
\
 N -- N -- N   refs/heads/fix/WW-5419-tiles (a88cb741d)

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:
 .../apache/struts2/tiles/StrutsTilesContainerFactory.java| 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)



(struts) 01/01: WW-5419 Fixes support for loading Tiles definitions

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

lukaszlenart pushed a commit to branch fix/WW-5419-tiles
in repository https://gitbox.apache.org/repos/asf/struts.git

commit a88cb741d0296302d033b7e13e4a7806b345dea3
Author: Lukasz Lenart 
AuthorDate: Sun Apr 21 10:21:55 2024 +0200

WW-5419 Fixes support for loading Tiles definitions
---
 plugins/tiles/pom.xml  | 10 +++
 .../struts2/tiles/StrutsTilesContainerFactory.java | 16 ++---
 .../StrutsWildcardServletApplicationContext.java   |  9 ++-
 .../tiles/StrutsTilesContainerFactoryTest.java |  9 ++-
 ...trutsWildcardServletApplicationContextTest.java | 79 ++
 plugins/tiles/src/test/resources/WEB-INF/tiles.xml | 39 +++
 .../org/apache/tiles/core/config/tiles_defs1.xml   | 75 
 7 files changed, 216 insertions(+), 21 deletions(-)

diff --git a/plugins/tiles/pom.xml b/plugins/tiles/pom.xml
index 618bc6a8c..53d79b89d 100644
--- a/plugins/tiles/pom.xml
+++ b/plugins/tiles/pom.xml
@@ -102,6 +102,16 @@
 log4j-jcl
 test
 
+
+org.assertj
+assertj-core
+test
+
+
+org.springframework
+spring-test
+test
+
 
 
 UTF-8
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 ed03f8268..4cda08522 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
@@ -68,10 +68,7 @@ import javax.el.MapELResolver;
 import javax.el.ResourceBundleELResolver;
 import javax.servlet.jsp.JspFactory;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -105,19 +102,16 @@ public class StrutsTilesContainerFactory extends 
BasicTilesContainerFactory {
 
 /**
  * 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";
+public static final Set TILES_DEFAULT_PATTERNS = 
TextParseUtil.commaDelimitedStringToSet("*tiles*.xml");
 
 /**
  * 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
  */
-public static final Set TILES_DEFAULT_PATTERNS = 
Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
-"/WEB-INF/**/tiles*.xml",
-"classpath*:META-INF/**/tiles*.xml"
-)));
+@Deprecated
+public static final String TILES_DEFAULT_PATTERN = String.join(",", 
TILES_DEFAULT_PATTERNS);
 
 /**
  * Supported expression languages
diff --git 
a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java
 
b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java
index 7af6069bb..2a30eb626 100644
--- 
a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java
+++ 
b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsWildcardServletApplicationContext.java
@@ -43,7 +43,7 @@ public class StrutsWildcardServletApplicationContext extends 
ServletApplicationC
 
 private static final Logger LOG = 
LogManager.getLogger(StrutsWildcardServletApplicationContext.class);
 
-private ResourceFinder finder;
+private final ResourceFinder finder;
 
 public StrutsWildcardServletApplicationContext(ServletContext context) {
 super(context);
@@ -64,16 +64,15 @@ public class StrutsWildcardServletApplicationContext 
extends ServletApplicationC
 }
 
 try {
-Enumeration resources = 
getClass().getClassLoader().getResources("/");
+Enumeration resources = 
getClass().getClassLoader().getResources("");
 while (resources.hasMoreElements()) {
-URL resource = resources.nextElement();
-urls.add(resource);
+urls.add(resources.nextElement());
 }
 } catch (IOException e) {
 throw new ConfigurationException(e);
 }
 
-finder = new ResourceFinder(urls.toArray(new URL[urls.size()]));
+finder = new ResourceFinder(urls.toArray(new URL[0]));
 }
 
 public Collection getResources(String path) {
diff --git 
a/plugins/tiles/src/test/java/org/apache/struts2/tiles/StrutsTilesContainerFactoryTest.java
 
b/plugins/tiles/