Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WW-5233] Include Apache Tiles code base in the Tiles plugin #608

Merged
merged 4 commits into from
Aug 1, 2023

Conversation

lukaszlenart
Copy link
Member

Fixes WW-5233

@sonarcloud
Copy link

sonarcloud bot commented Oct 19, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug B 2 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 200 Code Smells

62.6% 62.6% Coverage
3.8% 3.8% Duplication

@sonarcloud
Copy link

sonarcloud bot commented Jan 23, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug B 2 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 158 Code Smells

62.6% 62.6% Coverage
3.8% 3.8% Duplication

@asfgit asfgit force-pushed the WW-5233-tiles branch 2 times, most recently from 6f0df80 to a970d24 Compare June 29, 2023 10:40
@asfgit asfgit force-pushed the WW-5233-tiles branch 2 times, most recently from 4f2a13a to 93519c9 Compare July 16, 2023 07:18
@lukaszlenart lukaszlenart marked this pull request as ready for review July 25, 2023 05:16
WW-5233 Copies a based set of Tiles classes used by Struts

WW-5233 Copies Portlet related Tiles code base

WW-5233 Copies Tiles API related tests

WW-5233 Copies Tiles Core related tests

WW-5233 Copies Tiles EL related tests

WW-5233 Copies Tiles OGNL related tests

WW-5233 Copies Tiles Template related tests

WW-5233 Copies Tiles Servlet related tests

WW-5233 Upgrades Easymock to version 4.3 to support Java 17

WW-5233 Copies Tiles Request related tests

WW-5233 Copies Tiles Autotag related tests

WW-5233 Drops useless @Version tag and addresses some potential RegEx vulnerabilities

WW-5233 Addresses bugs reported by Sonar

WW-5233 Addresses a few code smells

WW-5233 Copies Tiles Portal related tests

WW-5233 Fixes broken test

WW-5233 Adds Tiles DTD definition

Add missing classes and tld definition.

Add generating of Autotags and tests.

Make plugin standalone with all generated resources.

Make plugin standalone with all generated resources for velocity.

Make plugin standalone with all generated resources for velocity.

WW-5233 Marks Velocity dependencies as optional
@sonarcloud
Copy link

sonarcloud bot commented Jul 30, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug B 2 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 158 Code Smells

62.6% 62.6% Coverage
3.8% 3.8% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@lukaszlenart
Copy link
Member Author

@gregh3269 @JCgH4164838Gh792C124B5 @kusalk any objections to merge this and release a new version?

@kusalk
Copy link
Member

kusalk commented Jul 30, 2023

We are not using Tiles or these plugins so no objections here :)

@gregh3269
Copy link
Contributor

+1. But then i am standard wrt tiles.

@lukaszlenart lukaszlenart merged commit 71e9ee7 into master Aug 1, 2023
8 of 9 checks passed
@lukaszlenart lukaszlenart deleted the WW-5233-tiles branch August 1, 2023 08:03
@HittiGubbi
Copy link

HittiGubbi commented Sep 20, 2023

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.

@gregh3269
Copy link
Contributor

gregh3269 commented Sep 20, 2023

@ 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>

@kusalk
Copy link
Member

kusalk commented Sep 20, 2023

Yes that listener is from the old deprecated plugin - see here for updated instructions

@HittiGubbi
Copy link

HittiGubbi commented Sep 20, 2023

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)

@kusalk
Copy link
Member

kusalk commented Sep 20, 2023

Looks like you're using a different version of commons-digester to the one included by Struts

@gregh3269
Copy link
Contributor

..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?

@gregh3269
Copy link
Contributor

gregh3269 commented Sep 21, 2023

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.

@HittiGubbi
Copy link

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 :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants