[WW-5233] Include Apache Tiles code base in the Tiles plugin
SonarCloud Quality Gate failed. 
2 Bugs
0 Vulnerabilities
0 Security Hotspots
158 Code Smells
62.6% Coverage
3.8% Duplication
Catch issues before they fail your Quality Gate with our IDE extension
SonarLint
@gregh3269 @JCgH4164838Gh792C124B5 @kusalk any objections to merge this and release a new version?
We are not using Tiles or these plugins so no objections here :)
+1. But then i am standard wrt tiles.
Is there some instructions how to migrate to 6.3.0 when using Tiles? After upgrading from 6.2.0 to 6.3.0, a web app (which worked fine on 6.2.0) fails to start due to an error:
java.lang.ClassNotFoundException: org.apache.tiles.extras.complete.CompleteAutoloadTilesListener
This comes from having this in web.xml:
<listener> <listener-class>org.apache.tiles.extras.complete.CompleteAutoloadTilesListener</listener-class> </listener>
The pom.xml has e.g.:
<dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-tiles-plugin</artifactId> <version>6.3.0</version> </dependency>
and
<dependency> <groupId>org.apache.tiles</groupId> <artifactId>tiles-core</artifactId> <version>3.0.8</version> </dependency>
Removing this last dependency (as the 6.3.0 release notes instruct to do?) does not help.
@ HittiGubbi what is org.apache.tiles.extras.complete.CompleteAutoloadTilesListener used for?
Would use
web.xml
<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
// So the ROOT##.war naming works
<context-param>
<param-name>org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG</param-name>
<param-value>
/WEB-INF/tiles.xml
</param-value>
</context-param>
pom.xml
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
<version>${org.apache.struts.version}</version>
</dependency>
Yes that listener is from the old deprecated plugin - see here for updated instructions
Thank you. I tried this but now get the error:
java.lang.NoSuchMethodError: 'void org.apache.commons.digester.Digester.setXIncludeAware(boolean)
at org.apache.tiles.core.definition.digester.DigesterDefinitionsReader.<init> (DigesterDefinitionsReader.java:270)
Looks like you're using a different version of commons-digester to the one included by Struts
..By using the org.apache.tiles.extras.complete.CompleteAutoloadTilesListener you get Wild Cards, EL, OGNL, MVEL support in your tiles.xml
https://stackoverflow.com/questions/10050433/ognl-and-wildcards-working-in-tiles-definitions-with-struts2-tiles-plugin/10067367#10067367
Can you share your tiles.xml please?
Can you try dropping the struts2-tiles-plugin and replace with tiles extras as it does not look like you are using the struts2 tiles plugin ie StrutsTilesListener.
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-extras</artifactId>
<version>3.0.8</version>
</dependency>
I tested this and it will start, but it brings a very old velocity 1.6, which won't work for me.
In the struts2-tiles-plugin <6.2.0 it had only a few classes, possibly none were being used, and was used to bring the tiles jars needed by your app.
Thank you all for the advice. The web app seems to be working now after changing to use org.apache.struts2.tiles.StrutsTilesListener and removing transitively included package dependency declarations from pom.xml :).