mirror of
https://github.com/apache/struts.git
synced 2026-08-06 07:06:58 +00:00
First cut at a simple plugin framework. The config files are loaded in the following order:
struts-default.xml, struts-plugin.xml, struts.xml, xwork.xml. This allows plugins to define a config file that uses core interceptors, but make their results, interceptors, etc available to application configurations. The extras and integration modules have been decomposed into their own plugins. WW-1457 git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@450330 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-integration</artifactId>
|
||||
<artifactId>struts2-struts1-plugin</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="integration" extends="struts-default,struts-integration-default" namespace="/integration">
|
||||
<package name="integration" extends="struts1-default" namespace="/integration">
|
||||
|
||||
<interceptors>
|
||||
<interceptor name="gangsterForm" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor">
|
||||
|
||||
@@ -251,9 +251,9 @@ public class Dispatcher {
|
||||
}
|
||||
|
||||
configurationManager = new ConfigurationManager();
|
||||
String configFiles = Settings.get(StrutsConstants.STRUTS_CONFIGURATION_FILES);
|
||||
if (configFiles == null) {
|
||||
configFiles = "struts-default.xml,struts-plugins.xml,struts.xml";
|
||||
String configFiles = "struts-default.xml,struts-plugin.xml,struts.xml";
|
||||
if (Settings.isSet(StrutsConstants.STRUTS_CONFIGURATION_FILES)) {
|
||||
configFiles = Settings.get(StrutsConstants.STRUTS_CONFIGURATION_FILES);
|
||||
}
|
||||
String[] files = configFiles.split("\\s*[,]\\s*");
|
||||
for (String file : files) {
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
<result-type name="plaintext" class="org.apache.struts2.dispatcher.PlainTextResult" />
|
||||
|
||||
<!-- third party integration
|
||||
<result-type name="jasper" class="org.apache.struts2.views.jasperreports.JasperReportsResult"/>
|
||||
<result-type name="jsf" class="org.apache.struts2.jsf.FacesResult" />
|
||||
-->
|
||||
</result-types>
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<include file="struts-default.xml"/>
|
||||
|
||||
<package name="struts-portlet-default" extends="struts-default">
|
||||
|
||||
<result-types>
|
||||
@@ -25,4 +23,4 @@
|
||||
<result type="velocity" name="success">${location}</result>
|
||||
</action>
|
||||
</package>
|
||||
</struts>
|
||||
</struts>
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-extras</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Struts Extras</name>
|
||||
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>apache-site</id>
|
||||
<url>scp://people.apache.org/www/struts.apache.org/2.x/struts-extras</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>jasperreports</groupId>
|
||||
<artifactId>jasperreports</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mockobjects</groupId>
|
||||
<artifactId>mockobjects-core</artifactId>
|
||||
<version>0.09</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>pell-multipart</artifactId>
|
||||
<version>2.1.5</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.0.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="struts-integration-default">
|
||||
|
||||
<interceptors>
|
||||
<interceptor name="actionForm-reset" class="org.apache.struts2.s1.ActionFormResetInterceptor"/>
|
||||
<interceptor name="actionForm-validation" class="org.apache.struts2.s1.ActionFormValidationInterceptor"/>
|
||||
</interceptors>
|
||||
</package>
|
||||
|
||||
</struts>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-jasperreports-plugin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Struts 2 Jasper Reports Plugin</name>
|
||||
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>apache-site</id>
|
||||
<url>scp://people.apache.org/www/struts.apache.org/2.x/plugins/jasperreports</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>jasperreports</groupId>
|
||||
<artifactId>jasperreports</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="extras-default">
|
||||
|
||||
<result-types>
|
||||
<result-type name="jasper" class="org.apache.struts2.views.jasperreports.JasperReportsResult"/>
|
||||
</result-types>
|
||||
</package>
|
||||
|
||||
</struts>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-jfreechart-plugin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Struts 2 JFreeChart Plugin</name>
|
||||
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>apache-site</id>
|
||||
<url>scp://people.apache.org/www/struts.apache.org/2.x/plugins/jfreechart</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>jfree</groupId>
|
||||
<artifactId>jcommon</artifactId>
|
||||
<version>[1.0.0,)</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>gnujaxp</groupId>
|
||||
<artifactId>gnujaxp</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jfree</groupId>
|
||||
<artifactId>jfreechart</artifactId>
|
||||
<version>[1.0.0,)</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>gnujaxp</groupId>
|
||||
<artifactId>gnujaxp</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mockobjects</groupId>
|
||||
<artifactId>mockobjects-core</artifactId>
|
||||
<version>0.09</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="extras-default">
|
||||
|
||||
<result-types>
|
||||
<result-type name="chart" class="org.apache.struts2.dispatcher.ChartResult">
|
||||
<param name="height">150</param>
|
||||
<param name="width">200</param>
|
||||
</result-type>
|
||||
</result-types>
|
||||
</package>
|
||||
|
||||
</struts>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-pell-multipart-plugin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Struts 2 Pell Multipart Plugin</name>
|
||||
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>apache-site</id>
|
||||
<url>scp://people.apache.org/www/struts.apache.org/2.x/plugins/pell-multipart</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>pell-multipart</artifactId>
|
||||
<version>2.1.5</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Struts Plugins</name>
|
||||
<modules>
|
||||
<module>struts1</module>
|
||||
<module>pell-multipart</module>
|
||||
<module>jasperreports</module>
|
||||
<module>jfreechart</module>
|
||||
</modules>
|
||||
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>apache-site</id>
|
||||
<url>scp://people.apache.org/www/struts.apache.org/2.x/plugins</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Test dependencies -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>compile</scope>
|
||||
<version>3.8.1</version>
|
||||
<!-- has to be compile for StrutsTestCase, which is part of the base package so others can write unit tests -->
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -4,42 +4,22 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-integration</artifactId>
|
||||
<artifactId>struts2-struts1-plugin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Struts 2 Integration</name>
|
||||
<name>Struts 2 Struts 1 Plugin</name>
|
||||
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>apache-site</id>
|
||||
<url>scp://people.apache.org/www/struts.apache.org/2.x/struts-integration</url>
|
||||
<url>scp://people.apache.org/www/struts.apache.org/2.x/plugins/struts1</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts-core</artifactId>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.0.dtd">
|
||||
|
||||
<struts>
|
||||
<package name="struts1-default" extends="struts-default">
|
||||
|
||||
<interceptors>
|
||||
<interceptor name="actionForm-reset" class="org.apache.struts2.s1.ActionFormResetInterceptor"/>
|
||||
<interceptor name="actionForm-validation" class="org.apache.struts2.s1.ActionFormValidationInterceptor"/>
|
||||
<interceptor name="actionForm-commonsValidation" class="org.apache.struts2.s1.ActionFormValidationInterceptor">
|
||||
<param name="pathnames">/org/apache/struts/validator/validator-rules.xml,/WEB-INF/validation.xml</param>
|
||||
</interceptor>
|
||||
<interceptor-stack name="struts1-default">
|
||||
<interceptor-ref name="static-params"/>
|
||||
<interceptor-ref name="scoped-model-driven"/>
|
||||
<interceptor-ref name="model-driven"/>
|
||||
<interceptor-ref name="actionForm-reset"/>
|
||||
<interceptor-ref name="basicStack"/>
|
||||
<interceptor-ref name="actionForm-validation"/>
|
||||
<interceptor-ref name="workflow"/>
|
||||
</interceptor-stack>
|
||||
</interceptors>
|
||||
|
||||
</package>
|
||||
|
||||
</struts>
|
||||
Reference in New Issue
Block a user