Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 20 additions & 28 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,6 @@
<groovyVersion>4.0.15</groovyVersion>
<seleniumVersion>4.15.0</seleniumVersion>
<slf4jVersion>2.0.9</slf4jVersion>
<tilesVersion>3.0.8</tilesVersion>
<tilesRequestVersion>1.0.7</tilesRequestVersion>
<antlrVersion>4.13.1</antlrVersion>
<servletVersion>4.0.4</servletVersion>
<jspVersion>2.3.6</jspVersion>
Expand Down Expand Up @@ -519,6 +517,7 @@
<module>taglib</module>
<module>tiles</module>
<module>tiles2</module>
<module>tiles3</module>
</modules>

<licenses>
Expand Down Expand Up @@ -814,6 +813,20 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>

Expand Down Expand Up @@ -1156,32 +1169,6 @@
<artifactId>groovy-jsr223</artifactId>
<version>${groovyVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-api</artifactId>
<version>${tilesVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>${tilesVersion}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-request-api</artifactId>
<version>${tilesRequestVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-request-servlet</artifactId>
<version>${tilesRequestVersion}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>struts-blank</artifactId>
Expand Down Expand Up @@ -1278,6 +1265,11 @@
<artifactId>struts-tiles2</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>struts-tiles3</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>struts-mailreader-dao</artifactId>
Expand Down
205 changes: 108 additions & 97 deletions tiles2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -22,107 +22,118 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<parent>
<groupId>io.github.weblegacy</groupId>
<artifactId>struts-parent</artifactId>
<version>1.4.6-SNAPSHOT</version>
</parent>
<parent>
<groupId>io.github.weblegacy</groupId>
<artifactId>struts-parent</artifactId>
<version>1.4.6-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>struts-tiles2</artifactId>
<packaging>jar</packaging>
<name>Struts Tiles 2 integration</name>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts-tiles2</artifactId>
<packaging>jar</packaging>
<name>Struts Tiles 2 integration</name>

<properties>
<struts.osgi.symbolicName>org.apache.struts.tiles2</struts.osgi.symbolicName>
</properties>
<properties>
<struts.osgi.symbolicName>org.apache.struts.tiles2</struts.osgi.symbolicName>
<tiles2Version>2.2.2</tiles2Version>
</properties>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>struts-core</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>struts-core</artifactId>
<classifier>tests</classifier>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.servlet.jsp</groupId>
<artifactId>jakarta.servlet.jsp-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-request-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-request-servlet</artifactId>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
</dependency>
<dependency>
<groupId>io.github.weblegacy</groupId>
<artifactId>commons-chain</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- Needed for commons-beanutils -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
</dependencies>

<reporting>
<plugins>
<plugin>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>struts-core</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>struts-core</artifactId>
<classifier>tests</classifier>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.servlet.jsp</groupId>
<artifactId>jakarta.servlet.jsp-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-api</artifactId>
<version>${tiles2Version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>${tiles2Version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-api</artifactId>
<version>${tiles2Version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-servlet</artifactId>
<version>${tiles2Version}</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
</dependency>
<dependency>
<groupId>io.github.weblegacy</groupId>
<artifactId>taglib-maven-plugin</artifactId>
<configuration>
<srcDir>${project.basedir}/src/main/resources/META-INF/tld</srcDir>
<parseHtml>true</parseHtml>
</configuration>
</plugin>
</plugins>
</reporting>
<artifactId>commons-chain</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- Needed for commons-beanutils -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
</dependencies>

<profiles>
<profile>
<id>pre-assembly</id>
<build>
<reporting>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<plugin>
<groupId>io.github.weblegacy</groupId>
<artifactId>taglib-maven-plugin</artifactId>
<configuration>
<srcDir>${project.basedir}/src/main/resources/META-INF/tld</srcDir>
<parseHtml>true</parseHtml>
</configuration>
</plugin>
</plugins>
</reporting>

<profiles>
<profile>
<id>pre-assembly</id>
<build>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@
import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.RequestProcessor;
import org.apache.struts.config.ModuleConfig;
import org.apache.tiles.definition.DefinitionsFactoryException;
import org.apache.tiles.definition.util.DefinitionsFactoryUtil;


/**
* <p>
* WebLogic (at least v6 and v7) attempts to serialize the TilesRequestProcessor
* when re-deploying the Webapp in development mode. The TilesRequestProcessor
* is not serializable, and loses the Tiles definitions. This results in
* NullPointerException and/or NotSerializableException when using the app after
* automatic redeploy.
* </p>
* <p>
* This bug report proposes a workaround for this problem, in the hope it will
* help others and maybe motivate an actual fix.
Expand All @@ -45,37 +50,43 @@
* For background discussion see
* <a href="https://issues.apache.org/jira/browse/STR-1937">STR-1937</a>.
* </p>
*
* @version $Rev$ $Date$
* @since 1.2.1
*/
public class RedeployableActionServlet extends ActionServlet {
private static final long serialVersionUID = -3681534284719373420L;

/**
* The request processor for Tiles definitions.
*/
private TilesRequestProcessor tileProcessor;

protected synchronized RequestProcessor getRequestProcessor(
final ModuleConfig config) throws ServletException {
/** {@inheritDoc} */
protected synchronized RequestProcessor
getRequestProcessor(ModuleConfig config) throws ServletException {

if (tileProcessor != null) {
final TilesRequestProcessor processor =
(TilesRequestProcessor) super.getRequestProcessor(config);
TilesRequestProcessor processor = (TilesRequestProcessor) super.getRequestProcessor(config);
return processor;
}

// reset the request processor
final String requestProcessorKey = Globals.REQUEST_PROCESSOR_KEY
String requestProcessorKey = Globals.REQUEST_PROCESSOR_KEY
+ config.getPrefix();
getServletContext().removeAttribute(requestProcessorKey);

// create a new request processor instance
final TilesRequestProcessor processor =
(TilesRequestProcessor) super.getRequestProcessor(config);
TilesRequestProcessor processor = (TilesRequestProcessor) super.getRequestProcessor(config);

tileProcessor = processor;

try {
// reload Tiles defs
DefinitionsFactoryUtil.reloadDefinitionsFactory(
getServletContext());
} catch (DefinitionsFactoryException e) {
e.printStackTrace();
}

return processor;
}
}
}
Loading