Skip to content

Commit

Permalink
Merge pull request #970 from apache/feature/WW-5430-freemarker-jakarta
Browse files Browse the repository at this point in the history
WW-5430 Uses Freemarker native support for JakartaEE instead of manually transforming the artifacts
  • Loading branch information
lukaszlenart authored Jun 24, 2024
2 parents 28a6867 + a7145d6 commit 6cebeac
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 107 deletions.
6 changes: 0 additions & 6 deletions apps/showcase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@
<configuration>
<outputDirectory>${project.build.directory}/extraclasspath</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-freemarker-jakarta</artifactId>
<destFileName>struts2-freemarker-jakarta.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh2-jakarta</artifactId>
Expand Down Expand Up @@ -241,7 +236,6 @@
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
<webApp>
<extraClasspath>
${project.build.directory}/extraclasspath/struts2-freemarker-jakarta.jar,
${project.build.directory}/extraclasspath/struts2-sitemesh2-jakarta.jar,
${project.build.directory}/extraclasspath/struts2-velocity-tools-view-jakarta.jar,
${project.build.directory}/extraclasspath/struts2-velocity-tools-jsp-jakarta
Expand Down
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@

<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-freemarker-jakarta</artifactId>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
import freemarker.cache.FileTemplateLoader;
import freemarker.cache.MultiTemplateLoader;
import freemarker.cache.TemplateLoader;
import freemarker.cache.WebappTemplateLoader;
import freemarker.ext.jakarta.servlet.WebappTemplateLoader;
import freemarker.core.HTMLOutputFormat;
import freemarker.core.TemplateClassResolver;
import freemarker.ext.jsp.TaglibFactory;
import freemarker.ext.servlet.HttpRequestHashModel;
import freemarker.ext.servlet.HttpRequestParametersHashModel;
import freemarker.ext.servlet.HttpSessionHashModel;
import freemarker.ext.servlet.ServletContextHashModel;
import freemarker.ext.jakarta.jsp.TaglibFactory;
import freemarker.ext.jakarta.servlet.HttpRequestHashModel;
import freemarker.ext.jakarta.servlet.HttpRequestParametersHashModel;
import freemarker.ext.jakarta.servlet.HttpSessionHashModel;
import freemarker.ext.jakarta.servlet.ServletContextHashModel;
import freemarker.template.Configuration;
import freemarker.template.ObjectWrapper;
import freemarker.template.TemplateException;
Expand Down
4 changes: 0 additions & 4 deletions jakarta/freemarker-jakarta/README.md

This file was deleted.

69 changes: 0 additions & 69 deletions jakarta/freemarker-jakarta/pom.xml

This file was deleted.

1 change: 0 additions & 1 deletion jakarta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
</properties>

<modules>
<module>freemarker-jakarta</module>
<module>sitemesh2-jakarta</module>
<module>velocity-tools-view-jakarta</module>
<module>velocity-tools-jsp-jakarta</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.opensymphony.module.sitemesh.RequestConstants;
import com.opensymphony.xwork2.ActionContext;
import freemarker.core.InvalidReferenceException;
import freemarker.ext.jakarta.servlet.FreemarkerServlet;
import freemarker.template.Configuration;
import freemarker.template.ObjectWrapper;
import freemarker.template.SimpleHash;
Expand Down Expand Up @@ -54,10 +55,9 @@
* Freemarker Manager in Struts instead of creating it's
* own manager</p>
*/
public class FreemarkerDecoratorServlet extends freemarker.ext.servlet.FreemarkerServlet {
public class FreemarkerDecoratorServlet extends FreemarkerServlet {

private static final Logger LOG = LogManager.getLogger(FreemarkerDecoratorServlet.class);
public static final long serialVersionUID = -2440216393145762479L;

protected FreemarkerManager freemarkerManager;
protected String templatePath;
Expand Down Expand Up @@ -273,7 +273,7 @@ protected freemarker.template.Configuration createConfiguration() {
* @param response the actual HTTP response
* @param template the template that will get executed
* @return true to process the template, false to suppress template processing.
* @see freemarker.ext.servlet.FreemarkerServlet#preTemplateProcess(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse, freemarker.template.Template, freemarker.template.TemplateModel)
* @see FreemarkerServlet#preTemplateProcess(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse, freemarker.template.Template, freemarker.template.TemplateModel)
*/
protected boolean preTemplateProcess(HttpServletRequest request, HttpServletResponse response, Template template, TemplateModel templateModel) throws ServletException, IOException {
boolean result = super.preTemplateProcess(request, response, template, templateModel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.apache.tiles.request.freemarker;

import freemarker.core.Environment;
import freemarker.ext.servlet.HttpRequestHashModel;
import freemarker.ext.jakarta.servlet.HttpRequestHashModel;
import org.apache.tiles.request.AbstractViewRequest;
import org.apache.tiles.request.ApplicationContext;
import org.apache.tiles.request.DispatchRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
package org.apache.tiles.request.freemarker;

import freemarker.core.Environment;
import freemarker.ext.servlet.FreemarkerServlet;
import freemarker.ext.servlet.HttpRequestHashModel;
import freemarker.ext.servlet.ServletContextHashModel;
import freemarker.ext.jakarta.servlet.FreemarkerServlet;
import freemarker.ext.jakarta.servlet.HttpRequestHashModel;
import freemarker.ext.jakarta.servlet.ServletContextHashModel;
import freemarker.template.TemplateModelException;
import org.apache.tiles.request.ApplicationContext;
import org.apache.tiles.request.servlet.ServletUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import freemarker.cache.ClassTemplateLoader;
import freemarker.cache.TemplateLoader;
import freemarker.cache.WebappTemplateLoader;
import freemarker.ext.jakarta.servlet.WebappTemplateLoader;

import jakarta.servlet.ServletContext;
import java.io.IOException;
Expand Down
11 changes: 0 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -506,19 +506,8 @@
<groupId>org.apache.struts</groupId>
<artifactId>struts-annotations</artifactId>
<version>1.0.8</version>
<exclusions>
<exclusion>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-freemarker-jakarta</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
Expand Down

0 comments on commit 6cebeac

Please sign in to comment.