Compare commits

..

1 Commits

Author SHA1 Message Date
Lukasz Lenart f706c2fb2f [maven-release-plugin] copy for tag STRUTS_2_3_10
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10@1443340 13f79535-47bb-0310-9956-ffa450edef68
2013-02-07 07:53:50 +00:00
296 changed files with 2580 additions and 7908 deletions
+6 -15
View File
@@ -26,17 +26,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-blank</artifactId>
<packaging>war</packaging>
<name>Blank Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15/apps/blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/apps/blank</url>
</scm>
<dependencies>
@@ -53,19 +53,10 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -1,26 +0,0 @@
#
# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)
#
# The five logging levels used by Log are (in order):
#
# 1. DEBUG (the least serious)
# 2. INFO
# 3. WARN
# 4. ERROR
# 5. FATAL (the most serious)
# Set root logger level to WARN and append to stdout
log4j.rootLogger=INFO, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n
# Print only messages of level ERROR or above in the package noModule.
log4j.logger.noModule=FATAL
log4j.logger.com.opensymphony.xwork2=DEBUG
log4j.logger.org.apache.struts2=DEBUG
-47
View File
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
+6 -5
View File
@@ -26,17 +26,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jboss-blank</artifactId>
<packaging>war</packaging>
<name>JBoss Blank Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15/apps/jboss-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/apps/jboss-blank</url>
</scm>
<dependencies>
@@ -57,6 +57,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
-47
View File
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
+5 -5
View File
@@ -26,17 +26,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
<packaging>war</packaging>
<name>Mail Reader Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15/apps/mailreader</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/apps/mailreader</url>
</scm>
<dependencies>
-47
View File
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
@@ -42,9 +42,9 @@
</modules>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15/apps</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/apps</url>
</scm>
<profiles>
+5 -5
View File
@@ -26,17 +26,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
<packaging>war</packaging>
<name>Portlet Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15/apps/portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/apps/portlet</url>
</scm>
<profiles>
-47
View File
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
+7 -2
View File
@@ -26,12 +26,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-showcase</artifactId>
<packaging>war</packaging>
<version>2.3.15</version>
<version>2.3.10</version>
<name>Struts 2 Rest Showcase Example</name>
<description>Struts 2 Rest Showcase Example</description>
@@ -39,14 +40,17 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
@@ -67,6 +71,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.jwebunit</groupId>
<artifactId>jwebunit-htmlunit-plugin</artifactId>
-47
View File
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
+18 -5
View File
@@ -26,19 +26,20 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
<packaging>war</packaging>
<name>Showcase Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15/apps/showcase</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/apps/showcase</url>
</scm>
<profiles>
<profile>
<id>hostedqa</id>
@@ -55,41 +56,49 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-struts1-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dojo-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jsf-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dwr-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-json-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
@@ -101,11 +110,13 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
@@ -128,10 +139,12 @@
<dependency>
<groupId>opensymphony</groupId>
<artifactId>sitemesh</artifactId>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>uk.ltd.getahead</groupId>
<artifactId>dwr</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
@@ -44,19 +44,19 @@ public class Skill implements IdEntity {
}
public String getName() {
return StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(name));
return name;
}
public void setName(String name) {
this.name = name;
this.name = StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(name));
}
public String getDescription() {
return StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(description));
return description;
}
public void setDescription(String description) {
this.description = description;
this.description = StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(description));
}
public Serializable getId() {
@@ -11,7 +11,7 @@
# Set root logger level to WARN and append to stdout
log4j.rootLogger=INFO, stdout
log4j.rootLogger=DEBUG, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
@@ -20,14 +20,17 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n
# Print only messages of level ERROR or above in the package noModule.
log4j.logger.noModule=INFO
log4j.logger.noModule=FATAL
# OpenSymphony Stuff
log4j.logger.freemarker=INFO
log4j.logger.com.opensymphony=INFO
log4j.logger.com.opensymphony.xwork2.ognl=INFO
log4j.logger.org.apache.struts2=INFO
log4j.logger.com.opensymphony.xwork2.ognl=ERROR
log4j.logger.org.apache.struts2=WARN
log4j.logger.org.apache.struts2.components=WARN
log4j.logger.org.apache.struts2.dispatcher=WARN
log4j.logger.org.apache.struts2.convention=INFO
# Spring Stuff
log4j.logger.org.springframework=INFO
log4j.logger.org.springframework=WARN
@@ -58,7 +58,7 @@
</field>
<field name="regexValidatorField">
<field-validator type="regex">
<param name="regex">.*\.txt</param>
<param name="expression">.*\.txt</param>
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
</field-validator>
</field>
@@ -52,7 +52,7 @@
</field>
<field name="regexValidatorField">
<field-validator type="regex">
<param name="regex"><![CDATA[ [^<>]+ ]]></param>
<param name="expression">.*\.txt</param>
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
</field-validator>
</field>
-47
View File
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
-48
View File
@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="modules"/>
<menu ref="reports"/>
</body>
</project>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Maven Archetypes</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes</url>
</scm>
<modules>
-48
View File
@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="modules"/>
<menu ref="reports"/>
</body>
</project>
+5 -5
View File
@@ -3,19 +3,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-blank</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Blank</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-blank</url>
</scm>
<properties>
@@ -1,68 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor name="struts2-archetype-blank">
<fileSets>
<fileSet filtered="true" packaged="true">
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSets>
<fileSet filtered="true" packaged="true">
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="true">
<directory>src/test/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="true">
<directory>src/main/resources</directory>
<includes>
<include>**/*package*.properties</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="true">
<directory>src/main/resources</directory>
<includes>
<include>**/*-validation.xml</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="false">
<directory>src/main/resources</directory>
<includes>
<include>**/struts.xml</include>
<include>**/example.xml</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="true">
<directory>src/test/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="true">
<directory>src/main/resources</directory>
<includes>
<include>**/*package*.properties</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/resources</directory>
<includes>
<include>log4j.properties</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="true">
<directory>src/main/resources</directory>
<includes>
<include>**/*-validation.xml</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="false">
<directory>src/main/resources</directory>
<includes>
<include>**/struts.xml</include>
<include>**/example.xml</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/webapp/example</directory>
<includes>
<include>**/*.jsp</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/webapp</directory>
<includes>
<include>**/index.html</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/webapp/WEB-INF</directory>
<includes>
<include>**/web.xml</include>
</includes>
</fileSet>
</fileSets>
<fileSet filtered="false" packaged="false">
<directory>src/main/webapp/example</directory>
<includes>
<include>**/*.jsp</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/webapp</directory>
<includes>
<include>**/index.html</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/webapp/WEB-INF</directory>
<includes>
<include>**/web.xml</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>
@@ -36,13 +36,7 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<version>1.1.1</version>
</dependency>
<dependency>
@@ -80,7 +74,7 @@
<systemProperties>
<systemProperty>
<name>log4j.configuration</name>
<value>file:\${basedir}/src/main/resources/log4j.properties</value>
<value>file:${basedir}/src/main/resources/log4j.properties</value>
</systemProperty>
<systemProperty>
<name>slf4j</name>
@@ -88,10 +82,10 @@
</systemProperty>
</systemProperties>
<scanIntervalSeconds>10</scanIntervalSeconds>
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppConfig>
<contextPath>\${artifactId}</contextPath>
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
<contextPath>/struts2-blank</contextPath>
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
</webAppConfig>
</configuration>
<dependencies>
@@ -1,30 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<!--
- This file is included by the struts.xml file as an example
- of how to break up the configuration file into multiple files.
-->
<struts>
<package name="example" namespace="/example" extends="struts-default">
<package name="example" namespace="/example" extends="struts-default">
<action name="HelloWorld" class="${package}.example.HelloWorld">
<result>/example/HelloWorld.jsp</result>
</action>
<default-action-ref name="HelloWorld" />
<action name="Login_*" method="{1}" class="${package}.example.Login">
<result name="input">/example/Login.jsp</result>
<result type="redirectAction">Menu</result>
</action>
<action name="HelloWorld" class="${package}.example.HelloWorld">
<result>/example/HelloWorld.jsp</result>
</action>
<action name="Login_*" method="{1}" class="${package}.example.Login">
<result name="input">/example/Login.jsp</result>
<result type="redirectAction">Menu</result>
</action>
<action name="*" class="${package}.example.ExampleSupport">
<result>/example/{1}.jsp</result>
</action>
<!-- Add additional "example" package actions here. -->
</package>
<action name="*" class="${package}.example.ExampleSupport">
<result>/example/{1}.jsp</result>
</action>
<!-- Add additional "example" package actions here. -->
</package>
</struts>
@@ -1,25 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
<constant name="struts.devMode" value="true"/>
<include file="example.xml"/>
<package name="default" namespace="/" extends="struts-default">
<default-action-ref name="index"/>
<action name="index">
<result type="redirectAction">
<param name="actionName">HelloWorld</param>
<param name="namespace">/example</param>
</result>
</action>
</package>
<!-- Add addition packages and configuration here. -->
<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
<constant name="struts.devMode" value="true"/>
<include file="example.xml"/>
<!-- Add addition packages and configuration here. -->
</struts>
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-convention</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Blank Convention</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-convention</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-convention</url>
</scm>
<properties>
@@ -23,13 +23,6 @@
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/resources</directory>
<includes>
<include>log4j.properties</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/resources</directory>
<includes>
@@ -42,13 +42,7 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<version>1.1</version>
</dependency>
<dependency>
@@ -94,7 +88,7 @@
<systemProperties>
<systemProperty>
<name>log4j.configuration</name>
<value>file:\${basedir}/src/main/resources/log4j.properties</value>
<value>file:${basedir}/src/main/resources/log4j.properties</value>
</systemProperty>
<systemProperty>
<name>slf4j</name>
@@ -102,10 +96,10 @@
</systemProperty>
</systemProperties>
<scanIntervalSeconds>10</scanIntervalSeconds>
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppConfig>
<contextPath>\${artifactId}</contextPath>
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
<contextPath>/struts2-showcase</contextPath>
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
</webAppConfig>
</configuration>
<dependencies>
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-dbportlet</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Database Portlet</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-dbportlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-dbportlet</url>
</scm>
<properties>
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
+5 -5
View File
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-plugin</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-plugin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-plugin</url>
</scm>
<properties>
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
+5 -5
View File
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-portlet</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Portlet</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-portlet</url>
</scm>
<properties>
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
+5 -5
View File
@@ -4,19 +4,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-starter</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Starter</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/archetypes/struts2-archetype-starter</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-starter</url>
</scm>
<properties>
@@ -66,21 +66,9 @@
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3</version>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- Dwr -->
<dependency>
<groupId>uk.ltd.getahead</groupId>
@@ -109,7 +97,7 @@
<systemProperties>
<systemProperty>
<name>log4j.configuration</name>
<value>file:\${basedir}/src/main/resources/log4j.properties</value>
<value>file:${basedir}/src/main/resources/log4j.properties</value>
</systemProperty>
<systemProperty>
<name>slf4j</name>
@@ -117,10 +105,10 @@
</systemProperty>
</systemProperties>
<scanIntervalSeconds>10</scanIntervalSeconds>
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppConfig>
<contextPath>\${artifactId}</contextPath>
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
<contextPath>/struts2-showcase</contextPath>
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
</webAppConfig>
</configuration>
<dependencies>
@@ -1,25 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
<package name="myPackage" extends="struts-default">
<default-action-ref name="index" />
<action name="index" class="${package}.IndexAction">
<result>/jsp/index.jsp</result>
</action>
<action name="helloWorld" class="helloWorldAction">
<result name="input">/jsp/index.jsp</result>
<result>/jsp/helloWorld.jsp</result>
</action>
</package>
<package name="myPackage" extends="struts-default">
<action name="index" class="${package}.IndexAction">
<result>/jsp/index.jsp</result>
</action>
<action name="helloWorld" class="helloWorldAction">
<result name="input">/jsp/index.jsp</result>
<result>/jsp/helloWorld.jsp</result>
</action>
</package>
</struts>
@@ -14,20 +14,20 @@
<!-- Filters -->
<filter>
<filter-name>struts2-prepare</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
<filter-name>action2-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<filter>
<filter-name>struts2-execute</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class>
<filter-name>action2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2-prepare</filter-name>
<filter-name>action2-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
@@ -35,7 +35,7 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2-execute</filter-name>
<filter-name>action2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
+222 -22
View File
@@ -1,31 +1,207 @@
<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.3.15</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-assembly</artifactId>
<packaging>pom</packaging>
<name>Struts 2 Assembly</name>
<description>
Struts 2 Assembly
</description>
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.10</version>
</parent>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15/assembly</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/assembly</url>
</scm>
<profiles>
<profile>
<id>j4</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptors>
<descriptor>src/main/assembly/all.xml</descriptor>
<descriptor>src/main/assembly/lib.xml</descriptor>
<descriptor>src/main/assembly/lib-jdk14.xml</descriptor>
<descriptor>src/main/assembly/apps.xml</descriptor>
<descriptor>src/main/assembly/src.xml</descriptor>
<descriptor>src/main/assembly/docs.xml</descriptor>
</descriptors>
<finalName>struts-${project.version}</finalName>
<outputDirectory>target/assembly/out</outputDirectory>
<workDirectory>target/assembly/work</workDirectory>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Backported JDK 1.4 jars -->
<dependency>
<groupId>net.sf.retrotranslator</groupId>
<artifactId>retrotranslator-runtime</artifactId>
<version>1.2.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>backport-util-concurrent</groupId>
<artifactId>backport-util-concurrent</artifactId>
<version>3.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.struts.xwork</groupId>
<artifactId>xwork-core</artifactId>
<version>${project.version}</version>
<type>jar</type>
<classifier>jdk14</classifier>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jasperreports-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jfreechart-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jsf-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-pell-multipart-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plexus-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitegraph-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-struts1-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-oval-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-json-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-embeddedjsp-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-gxp-plugin</artifactId>
<version>${project.version}</version>
<classifier>jdk14</classifier>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<generateReports>false</generateReports>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>dependency-maven-plugin</artifactId>
@@ -115,6 +291,7 @@
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>make-assembly</id>
@@ -145,142 +322,165 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-codebehind-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-javatemplates-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dojo-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dwr-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jasperreports-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jfreechart-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jsf-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-pell-multipart-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plexus-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitegraph-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-struts1-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-testng-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles3-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-oval-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-json-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-embeddedjsp-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-gxp-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-admin-bundle</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-demo-bundle</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
+3 -1
View File
@@ -31,8 +31,10 @@
<outputDirectory>lib</outputDirectory>
<scope>runtime</scope>
<excludes>
<exclude>net.sf.retrotranslator:retrotranslator-runtime</exclude>
<exclude>backport-util-concurrent:backport-util-concurrent</exclude>
<exclude>junit:junit</exclude>
<exclude>org.testng:testng</exclude>
<exclude>*:jdk14</exclude>
</excludes>
</dependencySet>
</dependencySets>
+58
View File
@@ -0,0 +1,58 @@
<!--
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<assembly>
<id>lib-jdk14</id>
<formats>
<format>zip</format>
</formats>
<dependencySets>
<dependencySet useTransitiveFiltering="true">
<outputDirectory>jdk14</outputDirectory>
<outputFileNameMapping>${artifactId}-${version}.${extension}</outputFileNameMapping>
<includes>
<include>net.sf.retrotranslator:retrotranslator-runtime</include>
<include>backport-util-concurrent:backport-util-concurrent</include>
</includes>
</dependencySet>
<dependencySet>
<useTransitiveFiltering>true</useTransitiveFiltering>
<outputDirectory>jdk14</outputDirectory>
<outputFileNameMapping>${artifactId}-${version}-jdk14.${extension}</outputFileNameMapping>
<includes>
<include>org.apache.struts:*:jar:jdk14</include>
<include>com.opensymphony:xwork:jar:jdk14</include>
</includes>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>src/main/resources/backport</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*LICENSE*</include>
<include>NOTICE*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
+3 -1
View File
@@ -31,8 +31,10 @@
<outputDirectory>lib</outputDirectory>
<scope>runtime</scope>
<excludes>
<exclude>net.sf.retrotranslator:retrotranslator-runtime</exclude>
<exclude>backport-util-concurrent:backport-util-concurrent</exclude>
<exclude>junit:junit</exclude>
<exclude>org.testng:testng</exclude>
<exclude>*:jdk14</exclude>
</excludes>
</dependencySet>
</dependencySets>
+9 -7
View File
@@ -4,24 +4,25 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<artifactId>struts2-osgi-admin-bundle</artifactId>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-admin-bundle</artifactId>
<packaging>bundle</packaging>
<name>Struts 2 OSGi Admin Bundle</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15/bundles/admin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/bundles/admin</url>
</scm>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-plugin</artifactId>
</dependency>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
@@ -30,6 +31,7 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<version>2.1.0</version>
<configuration>
<instructions>
<manifestLocation>META-INF</manifestLocation>
@@ -26,8 +26,9 @@ import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.osgi.BundleAccessor;
import org.apache.struts2.osgi.host.OsgiHost;
import org.apache.struts2.osgi.OsgiHost;
import org.apache.struts2.osgi.StrutsOsgiListener;
import org.apache.struts2.osgi.OsgiConfigurationProvider;
import org.apache.struts2.util.ServletContextAware;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -39,6 +40,10 @@ import java.util.Collection;
import java.util.List;
import java.util.Collections;
import java.util.Comparator;
import java.util.Map;
import java.util.HashMap;
import java.util.Enumeration;
import java.util.Dictionary;
public class BundlesAction extends ActionSupport implements ServletContextAware {
-47
View File
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
+13 -5
View File
@@ -4,17 +4,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-demo-bundle</artifactId>
<packaging>bundle</packaging>
<name>Struts 2 OSGi Demo Bundle</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15/bundles/demo</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/bundles/demo</url>
</scm>
<dependencies>
@@ -35,14 +35,22 @@
<artifactId>commons-digester</artifactId>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-plugin</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
-47
View File
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
+6 -5
View File
@@ -26,17 +26,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<packaging>pom</packaging>
<name>Struts OSGi Bundles</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/bundles</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/bundles</url>
</scm>
<modules>
@@ -49,6 +49,7 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Test dependencies -->
-48
View File
@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
/*
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<project name="Struts 2">
<bannerLeft>
<name>Apache Software Foundation</name>
<src>http://www.apache.org/images/asf-logo.gif</src>
<href>http://www.apache.org/</href>
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
</bannerRight>
<body>
<links>
<item name="Apache"
href="http://www.apache.org/"/>
<item name="Struts"
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="modules"/>
<menu ref="reports"/>
</body>
</project>
+7 -4
View File
@@ -26,16 +26,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.15</version>
<version>2.3.10</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<packaging>jar</packaging>
<name>Struts 2 Core</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15/core</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/core</url>
</scm>
<properties>
@@ -86,6 +87,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rat-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<configuration>
<includes>
<include>pom.xml</include>
@@ -110,6 +112,7 @@
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>attach-source</id>
@@ -228,12 +228,6 @@ public final class StrutsConstants {
/** Enables caching of parsed OGNL expressions **/
public static final String STRUTS_ENABLE_OGNL_EXPRESSION_CACHE = "struts.ognl.enableExpressionCache";
/** Enables evaluation of OGNL expressions **/
public static final String STRUTS_ENABLE_OGNL_EVAL_EXPRESSION = "struts.ognl.enableOGNLEvalExpression";
/** Disables {@link org.apache.struts2.dispatcher.StrutsRequestWrapper} request attribute value stack lookup (JSTL accessibility) **/
public static final String STRUTS_DISABLE_REQUEST_ATTRIBUTE_VALUE_STACK_LOOKUP = "struts.disableRequestAttributeValueStackLookup";
/** The{@link org.apache.struts2.views.util.UrlHelper} implementation class **/
public static final String STRUTS_URL_HELPER = "struts.view.urlHelper";
@@ -253,9 +247,4 @@ public final class StrutsConstants {
public static final String STRUTS_CONVERTER_CREATOR = "struts.converter.creator";
public static final String STRUTS_CONVERTER_HOLDER = "struts..converter.holder";
public static final String STRUTS_EXPRESSION_PARSER = "struts.expression.parser";
/** actions names' whitelist **/
public static final String STRUTS_ALLOWED_ACTION_NAMES = "struts.allowed.action.names";
}
@@ -53,7 +53,7 @@ public class Component {
public static final String COMPONENT_STACK = "__component_stack";
protected ValueStack stack;
protected Map<String, Object> parameters;
protected Map parameters;
protected ActionMapper actionMapper;
protected boolean throwExceptionOnELFailure;
private UrlHelper urlHelper;
@@ -65,7 +65,7 @@ public class Component {
*/
public Component(ValueStack stack) {
this.stack = stack;
this.parameters = new LinkedHashMap<String, Object>();
this.parameters = new LinkedHashMap();
getComponentStack().push(this);
}
@@ -107,10 +107,10 @@ public class Component {
* Gets the component stack of this component.
* @return the component stack of this component, never <tt>null</tt>.
*/
public Stack<Component> getComponentStack() {
Stack<Component> componentStack = (Stack<Component>) stack.getContext().get(COMPONENT_STACK);
public Stack getComponentStack() {
Stack componentStack = (Stack) stack.getContext().get(COMPONENT_STACK);
if (componentStack == null) {
componentStack = new Stack<Component>();
componentStack = new Stack();
stack.getContext().put(COMPONENT_STACK, componentStack);
}
return componentStack;
@@ -449,7 +449,7 @@ public class Component {
* Gets the parameters.
* @return the parameters. Is never <tt>null</tt>.
*/
public Map<String, Object> getParameters() {
public Map getParameters() {
return parameters;
}
@@ -457,7 +457,7 @@ public class Component {
* Adds all the given parameters to this component's own parameters.
* @param params the parameters to add.
*/
public void addAllParameters(Map<String, Object> params) {
public void addAllParameters(Map params) {
parameters.putAll(params);
}
@@ -472,7 +472,7 @@ public class Component {
*/
public void addParameter(String key, Object value) {
if (key != null) {
Map<String, Object> params = getParameters();
Map params = getParameters();
if (value == null) {
params.remove(key);
@@ -31,22 +31,16 @@ import com.opensymphony.xwork2.interceptor.MethodFilterInterceptorUtil;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.validator.ActionValidatorManager;
import com.opensymphony.xwork2.validator.FieldValidator;
import com.opensymphony.xwork2.validator.ValidationException;
import com.opensymphony.xwork2.validator.ValidationInterceptor;
import com.opensymphony.xwork2.validator.Validator;
import com.opensymphony.xwork2.validator.ValidatorContext;
import com.opensymphony.xwork2.validator.validators.VisitorFieldValidator;
import org.apache.commons.lang3.StringUtils;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.commons.lang3.StringUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.*;
import java.util.Set;
/**
@@ -122,17 +116,14 @@ public class Form extends ClosingUIBean {
super(stack, request, response);
}
@Override
protected boolean evaluateNameValue() {
return false;
}
@Override
public String getDefaultOpenTemplate() {
return OPEN_TEMPLATE;
}
@Override
protected String getDefaultTemplate() {
return TEMPLATE;
}
@@ -162,7 +153,6 @@ public class Form extends ClosingUIBean {
* Revised for Portlet actionURL as form action, and add wwAction as hidden
* field. Refer to template.simple/form.vm
*/
@Override
protected void evaluateExtraParams() {
super.evaluateExtraParams();
if (validate != null) {
@@ -220,7 +210,6 @@ public class Form extends ClosingUIBean {
* <li>if an 'action' attribute is specified, it will be used as the id.</li>
* </ol>
*/
@Override
protected void populateComponentHtmlId(Form form) {
if (id != null) {
addParameter("id", escape(id));
@@ -273,144 +262,20 @@ public class Form extends ClosingUIBean {
return Collections.EMPTY_LIST;
}
String formActionValue = findString(action);
ActionMapping mapping = actionMapper.getMappingFromActionName(formActionValue);
String actionName = mapping.getName();
String methodName = mapping.getMethod();
List<Validator> actionValidators = actionValidatorManager.getValidators(actionClass, actionName, methodName);
List<Validator> all = actionValidatorManager.getValidators(actionClass, (String) getParameters().get("actionName"));
List<Validator> validators = new ArrayList<Validator>();
findFieldValidators(name, actionClass, actionName, actionValidators, validators, "");
return validators;
}
private void findFieldValidators(String name, Class actionClass, String actionName,
List<Validator> validatorList, List<Validator> retultValidators, String prefix) {
for (Validator validator : validatorList) {
for (Validator validator : all) {
if (validator instanceof FieldValidator) {
FieldValidator fieldValidator = (FieldValidator) validator;
if (validator instanceof VisitorFieldValidator) {
VisitorFieldValidator vfValidator = (VisitorFieldValidator) fieldValidator;
Class clazz = getVisitorReturnType(actionClass, vfValidator.getFieldName());
if (clazz == null) {
continue;
}
List<Validator> visitorValidators = actionValidatorManager.getValidators(clazz, actionName);
String vPrefix = prefix + (vfValidator.isAppendPrefix() ? vfValidator.getFieldName() + "." : "");
findFieldValidators(name, clazz, actionName, visitorValidators, retultValidators, vPrefix);
} else if ((prefix + fieldValidator.getFieldName()).equals(name)) {
if (StringUtils.isNotBlank(prefix)) {
//fixing field name for js side
FieldVisitorValidatorWrapper wrap = new FieldVisitorValidatorWrapper(fieldValidator, prefix);
retultValidators.add(wrap);
} else {
retultValidators.add(fieldValidator);
}
if (fieldValidator.getFieldName().equals(name)) {
validators.add(fieldValidator);
}
}
}
}
/**
* Wrap field validator, add visitor's field prefix to the field name.
* Javascript side is not aware of the visitor validators
* and does not know how to prefix the fields.
*/
/*
* Class is public because Freemarker has problems accessing properties.
*/
public static class FieldVisitorValidatorWrapper implements FieldValidator {
private FieldValidator fieldValidator;
private String namePrefix;
public FieldVisitorValidatorWrapper(FieldValidator fv, String namePrefix) {
this.fieldValidator = fv;
this.namePrefix = namePrefix;
}
public String getValidatorType() {
return "field-visitor";
}
public String getFieldName() {
return namePrefix + fieldValidator.getFieldName();
}
public FieldValidator getFieldValidator() {
return fieldValidator;
}
public void setFieldValidator(FieldValidator fieldValidator) {
this.fieldValidator = fieldValidator;
}
public String getDefaultMessage() {
return fieldValidator.getDefaultMessage();
}
public String getMessage(Object object) {
return fieldValidator.getMessage(object);
}
public String getMessageKey() {
return fieldValidator.getMessageKey();
}
public String[] getMessageParameters() {
return fieldValidator.getMessageParameters();
}
public ValidatorContext getValidatorContext() {
return fieldValidator.getValidatorContext();
}
public void setDefaultMessage(String message) {
fieldValidator.setDefaultMessage(message);
}
public void setFieldName(String fieldName) {
fieldValidator.setFieldName(fieldName);
}
public void setMessageKey(String key) {
fieldValidator.setMessageKey(key);
}
public void setMessageParameters(String[] messageParameters) {
fieldValidator.setMessageParameters(messageParameters);
}
public void setValidatorContext(ValidatorContext validatorContext) {
fieldValidator.setValidatorContext(validatorContext);
}
public void setValidatorType(String type) {
fieldValidator.setValidatorType(type);
}
public void setValueStack(ValueStack stack) {
fieldValidator.setValueStack(stack);
}
public void validate(Object object) throws ValidationException {
fieldValidator.validate(object);
}
public String getNamePrefix() {
return namePrefix;
}
public void setNamePrefix(String namePrefix) {
this.namePrefix = namePrefix;
}
return validators;
}
/**
* Return type of visited object.
* @param actionClass
* @param visitorFieldName
* @return
*/
@SuppressWarnings("unchecked")
protected Class getVisitorReturnType(Class actionClass, String visitorFieldName) {
if (visitorFieldName == null) {
return null;
}
String methodName = "get" + org.apache.commons.lang.StringUtils.capitalize(visitorFieldName);
try {
Method method = actionClass.getMethod(methodName, new Class[0]);
return method.getReturnType();
} catch (NoSuchMethodException e) {
return null;
}
}
/**
* Get a incrementing sequence unique to this <code>Form</code> component.
* It is used by <code>Form</code> component's child that might need a
@@ -43,6 +43,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -152,7 +153,7 @@ import java.util.concurrent.ConcurrentMap;
* <td>define label position of form element (top/left), default to left</td>
* </tr>
* <tr>
* <td>requiredPosition</td>
* <td>requiredposition</td>
* <td>xhtml</td>
* <td>String</td>
* <td>define required label position of form element (left/right), default to right</td>
@@ -670,7 +671,7 @@ public abstract class UIBean extends Component {
}
if (requiredPosition != null) {
addParameter("requiredPosition", findString(requiredPosition));
addParameter("requiredposition", findString(requiredPosition));
}
if (errorPosition != null) {
@@ -805,7 +806,7 @@ public abstract class UIBean extends Component {
if ( name != null ) {
// list should have been created by the form component
List<String> tags = (List<String>) form.getParameters().get("tagNames");
List tags = (List) form.getParameters().get("tagNames");
tags.add(name);
}
}
@@ -828,8 +829,8 @@ public abstract class UIBean extends Component {
Map overallTooltipConfigMap = getTooltipConfig(form);
overallTooltipConfigMap.putAll(tooltipConfigMap); // override parent form's tooltip config
for (Object o : overallTooltipConfigMap.entrySet()) {
Map.Entry entry = (Map.Entry) o;
for (Iterator i = overallTooltipConfigMap.entrySet().iterator(); i.hasNext(); ) {
Map.Entry entry = (Map.Entry) i.next();
addParameter((String) entry.getKey(), entry.getValue());
}
}
@@ -880,7 +881,7 @@ public abstract class UIBean extends Component {
if (name != null) {
return name.replaceAll("[\\/\\.\\[\\]]", "_");
} else {
return null;
return "";
}
}
@@ -894,7 +895,7 @@ public abstract class UIBean extends Component {
if (val != null) {
return val.replaceAll("\"", "&#34;");
} else {
return null;
return "";
}
}
@@ -929,14 +930,14 @@ public abstract class UIBean extends Component {
protected Map getTooltipConfig(UIBean component) {
Object tooltipConfigObj = component.getParameters().get("tooltipConfig");
Map<String, String> tooltipConfig = new LinkedHashMap<String, String>();
Map tooltipConfig = new LinkedHashMap();
if (tooltipConfigObj instanceof Map) {
// we get this if its configured using
// 1] UI component's tooltipConfig attribute OR
// 2] <param name="tooltip" value="" /> param tag value attribute
tooltipConfig = new LinkedHashMap<String, String>((Map)tooltipConfigObj);
tooltipConfig = new LinkedHashMap((Map)tooltipConfigObj);
} else if (tooltipConfigObj instanceof String) {
// we get this if its configured using
@@ -944,16 +945,17 @@ public abstract class UIBean extends Component {
String tooltipConfigStr = (String) tooltipConfigObj;
String[] tooltipConfigArray = tooltipConfigStr.split("\\|");
for (String aTooltipConfigArray : tooltipConfigArray) {
String[] configEntry = aTooltipConfigArray.trim().split("=");
for (int a=0; a<tooltipConfigArray.length; a++) {
String[] configEntry = ((String)tooltipConfigArray[a].trim()).split("=");
String key = configEntry[0].trim();
String value;
String value = null;
if (configEntry.length > 1) {
value = configEntry[1].trim();
tooltipConfig.put(key, value);
} else {
}
else {
if (LOG.isWarnEnabled()) {
LOG.warn("component " + component + " tooltip config param " + key + " has no value defined, skipped");
LOG.warn("component "+component+" tooltip config param "+key+" has no value defined, skipped");
}
}
}
@@ -968,7 +970,7 @@ public abstract class UIBean extends Component {
}
/**
* Create HTML id element for the component and populate this component parameter
* Create HTML id element for the component and populate this component parmaeter
* map. Additionally, a parameter named escapedId is populated which contains the found id value filtered by
* {@link #escape(String)}, needed eg. for naming Javascript identifiers based on the id value.
*
@@ -979,23 +981,18 @@ public abstract class UIBean extends Component {
* <li>[this_component_name]</li>
* </ol>
*
* @param form enclosing form tag
* @param form
*/
protected void populateComponentHtmlId(Form form) {
String tryId;
String generatedId;
if (id != null) {
// this check is needed for backwards compatibility with 2.1.x
tryId = findStringIfAltSyntax(id);
} else if (null == (generatedId = escape(name != null ? findString(name) : null))) {
if (LOG.isDebugEnabled()) {
LOG.debug("Cannot determine id attribute for [#0], consider defining id, name or key attribute!", this);
}
tryId = null;
} else if (form != null) {
tryId = form.getParameters().get("id") + "_" + generatedId;
tryId = form.getParameters().get("id") + "_"
+ escape(name != null ? findString(name) : null);
} else {
tryId = generatedId;
tryId = escape(name != null ? findString(name) : null);
}
addParameter("id", tryId);
addParameter("escapedId", escape(tryId));
@@ -21,17 +21,19 @@
package org.apache.struts2.components;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import java.io.Writer;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.Writer;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <!-- START SNIPPET: javadoc -->
@@ -62,15 +64,15 @@ import java.io.Writer;
* <!-- START SNIPPET: params -->
*
* <ul>
* <li>action (String) - (value or action choose either one, if both exist value takes precedence) action's name (alias) </li>
* <li>action (String) - (value or action choose either one, if both exist value takes precedence) action's name (alias) <li>
* <li>value (String) - (value or action choose either one, if both exist value takes precedence) the url itself</li>
* <li>scheme (String) - http scheme (http, https) defaults to the scheme this request is in</li>
* <li>namespace - action's namespace</li>
* <li>method (String) - action's method name, defaults to 'execute'</li>
* <li>encode (Boolean) - url encode the generated url. Defaults to 'true'.</li>
* <li>includeParams (String) - The includeParams attribute may have the value 'none', 'get' or 'all'. Defaults to 'none'.
* none - include no parameters in the URL (default)
* get - include only GET parameters in the URL
* <li>includeParams (String) - The includeParams attribute may have the value 'none', 'get' or 'all'. Defaults to 'get'.
* none - include no parameters in the URL
* get - include only GET parameters in the URL (default)
* all - include both GET and POST parameters in the URL
* </li>
* <li>includeContext (Boolean) - Specifies whether to include the web app context path. Defaults to 'true'.</li>
@@ -49,7 +49,10 @@ import com.opensymphony.xwork2.inject.ContainerBuilder;
import com.opensymphony.xwork2.inject.Context;
import com.opensymphony.xwork2.inject.Factory;
import com.opensymphony.xwork2.inject.Scope;
import com.opensymphony.xwork2.util.*;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.PatternMatcher;
import com.opensymphony.xwork2.util.ValueStackFactory;
import com.opensymphony.xwork2.util.location.LocatableProperties;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
@@ -273,13 +276,6 @@ import java.util.StringTokenizer;
* <td>singleton</td>
* <td>Holds user converters' instances</td>
* </tr>
* <tr>
* <td>com.opensymphony.xwork2.util.TextParser</td>
* <td>struts.expression.parser</td>
* <td>singleton</td>
* <td>Used to parse expressions like ${foo.bar} or %{bar.foo} but it is up tp the TextParser's
* implementation what kind of opening char to use (#, $, %, etc)</td>
* </tr>
* </table>
*
* <!-- END SNIPPET: extensionPoints -->
@@ -359,8 +355,6 @@ public class BeanSelectionProvider implements ConfigurationProvider {
alias(UnknownHandlerManager.class, StrutsConstants.STRUTS_UNKNOWN_HANDLER_MANAGER, builder, props);
alias(UrlHelper.class, StrutsConstants.STRUTS_URL_HELPER, builder, props);
alias(TextParser.class, StrutsConstants.STRUTS_EXPRESSION_PARSER, builder, props);
if ("true".equalsIgnoreCase(props.getProperty(StrutsConstants.STRUTS_DEVMODE))) {
props.setProperty(StrutsConstants.STRUTS_I18N_RELOAD, "true");
props.setProperty(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, "true");
@@ -375,7 +369,6 @@ public class BeanSelectionProvider implements ConfigurationProvider {
// Convert Struts properties into XWork properties
convertIfExist(props, StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES, XWorkConstants.LOG_MISSING_PROPERTIES);
convertIfExist(props, StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE, XWorkConstants.ENABLE_OGNL_EXPRESSION_CACHE);
convertIfExist(props, StrutsConstants.STRUTS_ENABLE_OGNL_EVAL_EXPRESSION, XWorkConstants.ENABLE_OGNL_EVAL_EXPRESSION);
convertIfExist(props, StrutsConstants.STRUTS_ALLOW_STATIC_METHOD_ACCESS, XWorkConstants.ALLOW_STATIC_METHOD_ACCESS);
convertIfExist(props, StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, XWorkConstants.RELOAD_XML_CONFIGURATION);
@@ -21,21 +21,22 @@
package org.apache.struts2.config;
import java.util.Iterator;
import java.util.Locale;
import java.util.StringTokenizer;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.ConfigurationProvider;
import com.opensymphony.xwork2.inject.ContainerBuilder;
import com.opensymphony.xwork2.inject.Context;
import com.opensymphony.xwork2.inject.Factory;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.location.LocatableProperties;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsConstants;
import java.util.Iterator;
import java.util.Locale;
import java.util.StringTokenizer;
public class LegacyPropertiesConfigurationProvider implements ConfigurationProvider {
/**
@@ -68,10 +69,10 @@ public class LegacyPropertiesConfigurationProvider implements ConfigurationProvi
loadSettings(props, settings);
// Set default locale by lazily resolving the locale property as needed into a Locale object
builder.factory(Locale.class, new Factory<Locale>() {
builder.factory(Locale.class, new Factory() {
private Locale locale;
public synchronized Locale create(Context context) throws Exception {
public synchronized Object create(Context context) throws Exception {
if (locale == null) {
String loc = context.getContainer().getInstance(String.class, StrutsConstants.STRUTS_LOCALE);
if (loc != null) {
@@ -21,14 +21,16 @@
package org.apache.struts2.config;
import java.util.Iterator;
import java.util.Locale;
import java.util.StringTokenizer;
import org.apache.struts2.StrutsConstants;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.util.location.Location;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsConstants;
import java.util.Iterator;
import java.util.Locale;
/**
@@ -72,11 +74,6 @@ class Settings {
*/
static Settings defaultImpl;
/**
* Guard used to protect the defaultImpl initialisation.
*/
private static final Object DEFAULT_LOCK = new Object();
/**
* An instance of the default locale as specified by the <code>struts.locale</code> setting.
*
@@ -270,27 +267,23 @@ class Settings {
*/
private static Settings getDefaultInstance() {
if (defaultImpl == null) {
synchronized (DEFAULT_LOCK) {
if (defaultImpl == null) {
// Create bootstrap implementation
defaultImpl = new DefaultSettings();
// Create bootstrap implementation
defaultImpl = new DefaultSettings();
// Create default implementation
// Create default implementation
try {
String className = get(StrutsConstants.STRUTS_CONFIGURATION);
if (!className.equals(defaultImpl.getClass().getName())) {
try {
String className = get(StrutsConstants.STRUTS_CONFIGURATION);
if (!className.equals(defaultImpl.getClass().getName())) {
try {
// singleton instances shouldn't be built accessing request or session-specific context data
defaultImpl = (Settings) ObjectFactory.getObjectFactory().buildBean(Thread.currentThread().getContextClassLoader().loadClass(className), null);
} catch (Exception e) {
LOG.error("Settings: Could not instantiate the struts.configuration object, substituting the default implementation.", e);
}
}
} catch (IllegalArgumentException ex) {
// ignore
// singleton instances shouldn't be built accessing request or session-specific context data
defaultImpl = (Settings) ObjectFactory.getObjectFactory().buildBean(Thread.currentThread().getContextClassLoader().loadClass(className), null);
} catch (Exception e) {
LOG.error("Settings: Could not instantiate the struts.configuration object, substituting the default implementation.", e);
}
}
} catch (IllegalArgumentException ex) {
// ignore
}
}
@@ -301,10 +294,7 @@ class Settings {
* Resets the default and any plugin Setting instance to null.
*/
public static void reset() {
synchronized (DEFAULT_LOCK) {
defaultImpl = null;
}
defaultImpl = null;
settingsImpl = null;
}
}
@@ -27,7 +27,7 @@ class ContainerHolder {
}
public static void clear() {
ContainerHolder.instance.remove();
ContainerHolder.instance.set(null);
}
}
@@ -119,15 +119,10 @@ public class Dispatcher {
private ConfigurationManager configurationManager;
/**
* Store state of StrutsConstants.STRUTS_DEVMODE setting.
* Store state of StrutsConstants.STRUTS_DEVMODE setting.
*/
private boolean devMode;
/**
* Store state of StrutsConstants.DISABLE_REQUEST_ATTRIBUTE_VALUE_STACK_LOOKUP setting.
*/
private boolean disableRequestAttributeValueStackLookup;
/**
* Store state of StrutsConstants.STRUTS_I18N_ENCODING setting.
*/
@@ -144,9 +139,9 @@ public class Dispatcher {
private String multipartSaveDir;
/**
* Stores the value of StrutsConstants.STRUTS_MULTIPART_HANDLER setting
* Stores reference to instance of {@link MultiPartRequest} implementation defined by {@link StrutsConstants#STRUTS_MULTIPART_PARSER}
*/
private String multipartHandlerName;
private MultiPartRequest multipartHandler;
/**
* Provide list of default configuration files.
@@ -230,15 +225,6 @@ public class Dispatcher {
devMode = "true".equals(mode);
}
/**
* Modify state of StrutsConstants.DISABLE_REQUEST_ATTRIBUTE_VALUE_STACK_LOOKUP setting.
* @param disableRequestAttributeValueStackLookup New setting
*/
@Inject(value=StrutsConstants.STRUTS_DISABLE_REQUEST_ATTRIBUTE_VALUE_STACK_LOOKUP, required=false)
public void setDisableRequestAttributeValueStackLookup(String disableRequestAttributeValueStackLookup) {
this.disableRequestAttributeValueStackLookup = "true".equalsIgnoreCase(disableRequestAttributeValueStackLookup);
}
/**
* Modify state of StrutsConstants.STRUTS_LOCALE setting.
* @param val New setting
@@ -266,9 +252,9 @@ public class Dispatcher {
multipartSaveDir = val;
}
@Inject(StrutsConstants.STRUTS_MULTIPART_PARSER)
public void setMultipartHandler(String val) {
multipartHandlerName = val;
@Inject
public void setMultipartHandler(MultiPartRequest multiPartRequest) {
this.multipartHandler = multiPartRequest;
}
@Inject
@@ -329,9 +315,6 @@ public class Dispatcher {
interceptor.destroy();
}
// Clear container holder when application is unloaded / server shutdown
ContainerHolder.clear();
//cleanup action context
ActionContext.setContext(null);
@@ -791,37 +774,15 @@ public class Dispatcher {
String content_type = request.getContentType();
if (content_type != null && content_type.contains("multipart/form-data")) {
MultiPartRequest mpr = getMultiPartRequest();
LocaleProvider provider = getContainer().getInstance(LocaleProvider.class);
request = new MultiPartRequestWrapper(mpr, request, getSaveDir(servletContext), provider);
request = new MultiPartRequestWrapper(multipartHandler, request, getSaveDir(servletContext), provider);
} else {
request = new StrutsRequestWrapper(request, disableRequestAttributeValueStackLookup);
request = new StrutsRequestWrapper(request);
}
return request;
}
/**
* On each request it must return a new instance as implementation could be not thread safe
* and thus ensure of resource clean up
*
* @return
*/
protected MultiPartRequest getMultiPartRequest() {
MultiPartRequest mpr = null;
//check for alternate implementations of MultiPartRequest
Set<String> multiNames = getContainer().getInstanceNames(MultiPartRequest.class);
for (String multiName : multiNames) {
if (multiName.equals(multipartHandlerName)) {
mpr = getContainer().getInstance(MultiPartRequest.class, multiName);
}
}
if (mpr == null ) {
mpr = getContainer().getInstance(MultiPartRequest.class);
}
return mpr;
}
/**
* Removes all the files created by MultiPartRequestWrapper.
*
@@ -829,7 +790,6 @@ public class Dispatcher {
* @see org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper
*/
public void cleanUpRequest(HttpServletRequest request) {
ContainerHolder.clear();
if (!(request instanceof MultiPartRequestWrapper)) {
return;
}
@@ -910,15 +870,7 @@ public class Dispatcher {
}
}
/**
* Cleanup any resources used to initialise Dispatcher
*/
public void cleanUpAfterInit() {
if (LOG.isDebugEnabled()) {
LOG.debug("Cleaning up resources used to init Dispatcher");
}
ContainerHolder.clear();
}
/**
* Provide an accessor class for static XWork utility.
@@ -82,11 +82,6 @@ public class HttpHeaderResult implements Result {
private static final long serialVersionUID = 195648957144219214L;
private static final Logger LOG = LoggerFactory.getLogger(HttpHeaderResult.class);
/**
* This result type doesn't have a default param, null is ok to reduce noice in logs
*/
public static final String DEFAULT_PARAM = null;
private boolean parse = true;
private Map<String, String> headers;
private int status = -1;
@@ -198,9 +198,8 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
if (resultConfig != null) {
Map<String, String> resultConfigParams = resultConfig.getParams();
List<String> prohibitedResultParams = getProhibitedResultParams();
for (Map.Entry<String, String> e : resultConfigParams.entrySet()) {
if (!prohibitedResultParams.contains(e.getKey())) {
if (!getProhibitedResultParams().contains(e.getKey())) {
String potentialValue = e.getValue() == null ? "" : conditionalParse(e.getValue(), invocation);
if (!suppressEmptyParameters || ((potentialValue != null) && (potentialValue.length() > 0))) {
requestParameters.put(e.getKey(), potentialValue);
@@ -228,18 +227,7 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
}
protected List<String> getProhibitedResultParams() {
return Arrays.asList(
DEFAULT_PARAM,
"namespace",
"method",
"encode",
"parse",
"location",
"prependServletContext",
"suppressEmptyParameters",
"anchor",
"statusCode"
);
return Arrays.asList(DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location", "prependServletContext", "suppressEmptyParameters", "anchor");
}
/**
@@ -21,13 +21,11 @@
package org.apache.struts2.dispatcher;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.ValueStack;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import static org.apache.commons.lang3.BooleanUtils.isTrue;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.ValueStack;
/**
* <!-- START SNIPPET: javadoc -->
@@ -43,61 +41,49 @@ import static org.apache.commons.lang3.BooleanUtils.isTrue;
*/
public class StrutsRequestWrapper extends HttpServletRequestWrapper {
private static final String REQUEST_WRAPPER_GET_ATTRIBUTE = "__requestWrapper.getAttribute";
private final boolean disableRequestAttributeValueStackLookup;
/**
* The constructor
* @param req The request
*/
public StrutsRequestWrapper(HttpServletRequest req) {
this(req, false);
}
/**
* The constructor
* @param req The request
* @param disableRequestAttributeValueStackLookup flag for disabling request attribute value stack lookup (JSTL accessibility)
*/
public StrutsRequestWrapper(HttpServletRequest req, boolean disableRequestAttributeValueStackLookup) {
super(req);
this.disableRequestAttributeValueStackLookup = disableRequestAttributeValueStackLookup;
}
/**
* Gets the object, looking in the value stack if not found
*
* @param key The attribute key
* @param s The attribute key
*/
public Object getAttribute(String key) {
if (key == null) {
throw new NullPointerException("You must specify a key value");
}
if (disableRequestAttributeValueStackLookup || key.startsWith("javax.servlet")) {
public Object getAttribute(String s) {
if (s != null && s.startsWith("javax.servlet")) {
// don't bother with the standard javax.servlet attributes, we can short-circuit this
// see WW-953 and the forums post linked in that issue for more info
return super.getAttribute(key);
return super.getAttribute(s);
}
ActionContext ctx = ActionContext.getContext();
Object attribute = super.getAttribute(key);
if (ctx != null && attribute == null) {
boolean alreadyIn = isTrue((Boolean) ctx.get(REQUEST_WRAPPER_GET_ATTRIBUTE));
// note: we don't let # come through or else a request for
// #attr.foo or #request.foo could cause an endless loop
if (!alreadyIn && !key.contains("#")) {
try {
// If not found, then try the ValueStack
ctx.put(REQUEST_WRAPPER_GET_ATTRIBUTE, Boolean.TRUE);
ValueStack stack = ctx.getValueStack();
if (stack != null) {
attribute = stack.findValue(key);
Object attribute = super.getAttribute(s);
if (ctx != null) {
if (attribute == null) {
boolean alreadyIn = false;
Boolean b = (Boolean) ctx.get("__requestWrapper.getAttribute");
if (b != null) {
alreadyIn = b.booleanValue();
}
// note: we don't let # come through or else a request for
// #attr.foo or #request.foo could cause an endless loop
if (!alreadyIn && s.indexOf("#") == -1) {
try {
// If not found, then try the ValueStack
ctx.put("__requestWrapper.getAttribute", Boolean.TRUE);
ValueStack stack = ctx.getValueStack();
if (stack != null) {
attribute = stack.findValue(s);
}
} finally {
ctx.put("__requestWrapper.getAttribute", Boolean.FALSE);
}
} finally {
ctx.put(REQUEST_WRAPPER_GET_ATTRIBUTE, Boolean.FALSE);
}
}
}
@@ -197,13 +197,13 @@ public abstract class StrutsResultSupport implements Result, StrutsStatics {
if (parse && param != null && invocation != null) {
return TextParseUtil.translateVariables(param, invocation.getStack(),
new TextParseUtil.ParsedValueEvaluator() {
public Object evaluate(String parsedValue) {
public Object evaluate(Object parsedValue) {
if (encode) {
if (parsedValue != null) {
try {
// use UTF-8 as this is the recommended encoding by W3C to
// avoid incompatibilities.
return URLEncoder.encode(parsedValue, "UTF-8");
return URLEncoder.encode(parsedValue.toString(), "UTF-8");
}
catch(UnsupportedEncodingException e) {
if (LOG.isWarnEnabled()) {
@@ -21,10 +21,10 @@
package org.apache.struts2.dispatcher.mapper;
import com.opensymphony.xwork2.Result;
import java.util.Map;
import com.opensymphony.xwork2.Result;
/**
* Simple class that holds the action mapping information used to invoke a
* Struts action. The name and namespace are required, but the params map
@@ -157,17 +157,4 @@ public class ActionMapping {
public void setExtension(String extension) {
this.extension = extension;
}
@Override
public String toString() {
return "ActionMapping{" +
"name='" + name + '\'' +
", namespace='" + namespace + '\'' +
", method='" + method + '\'' +
", extension='" + extension + '\'' +
", params=" + params +
", result=" + (result != null ? result.getClass().getName() : "null") +
'}';
}
}
@@ -21,24 +21,60 @@
package org.apache.struts2.dispatcher.mapper;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.StrutsConstants;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsConstants;
import javax.servlet.http.HttpServletRequest;
import java.util.LinkedList;
import java.util.List;
/**
* <!-- START SNIPPET: description -->
*
* A composite action mapper that is capable of delegating to a series of {@link ActionMapper} if the former
* failed to obtained a valid {@link ActionMapping} or uri.
* <p/>
* It is configured through struts.properties.
* <p/>
* For example, with the following entries in struts.properties
* <p/>
* <pre>
* &lt;bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="struts"
* class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper" /&gt;
* &lt;constant name="struts.mapper.composite"
* value="org.apache.struts2.dispatcher.mapper.DefaultActionMapper,org.apache.struts2.dispatcher.mapper.RestfulActionMapper,org.apache.struts2.dispatcher.mapper.Restful2ActionMapper" /&gt;
* </pre>
* <p/>
* When {@link CompositeActionMapper#getMapping(HttpServletRequest, ConfigurationManager)} or
* {@link CompositeActionMapper#getUriFromActionMapping(ActionMapping)} is invoked,
* {@link CompositeActionMapper} would go through these {@link ActionMapper}s in sequence
* starting from {@link ActionMapper} identified by 'struts.mapper.composite.1', followed by
* 'struts.mapper.composite.2' and finally 'struts.mapper.composite.3' (in this case) until either
* one of the {@link ActionMapper} return a valid result (not null) or it runs out of {@link ActionMapper}
* in which case it will just return null for both
* {@link CompositeActionMapper#getMapping(HttpServletRequest, ConfigurationManager)} and
* {@link CompositeActionMapper#getUriFromActionMapping(ActionMapping)} methods.
* <p/>
*
* More details: http://struts.apache.org/2.x/docs/actionmapper.html
* For example with the following in struts-*.xml :-
* <pre>
* &lt;bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="struts"
* class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper" /&gt;
* &lt;constant name="struts.mapper.composite"
* value="org.apache.struts2.dispatcher.mapper.DefaultActionMapper,foo.bar.MyActionMapper,foo.bar.MyAnotherActionMapper" /&gt;
* </pre>
* <p/>
* <code>CompositeActionMapper</code> will be configured with 3 ActionMapper, namely
* "DefaultActionMapper", "MyActionMapper" and "MyAnotherActionMapper".
* <code>CompositeActionMapper</code> would consult each of them in order described above.
*
* <!-- END SNIPPET: description -->
*
* @see ActionMapper
* @see ActionMapping
@@ -49,11 +85,17 @@ public class CompositeActionMapper implements ActionMapper {
private static final Logger LOG = LoggerFactory.getLogger(CompositeActionMapper.class);
protected List<ActionMapper> actionMappers = new LinkedList<ActionMapper>();
protected Container container;
protected List<ActionMapper> actionMappers = new ArrayList<ActionMapper>();
@Inject
public CompositeActionMapper(Container container,
@Inject(value = StrutsConstants.STRUTS_MAPPER_COMPOSITE) String list) {
public void setContainer(Container container) {
this.container = container;
}
@Inject(StrutsConstants.STRUTS_MAPPER_COMPOSITE)
public void setActionMappers(String list) {
if (list != null) {
String[] arr = list.split(",");
for (String name : arr) {
@@ -65,6 +107,7 @@ public class CompositeActionMapper implements ActionMapper {
}
}
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
for (ActionMapper actionMapper : actionMappers) {
@@ -27,8 +27,6 @@ import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.commons.lang3.StringUtils;
import org.apache.struts2.RequestUtils;
import org.apache.struts2.ServletActionContext;
@@ -37,8 +35,12 @@ import org.apache.struts2.dispatcher.ServletRedirectResult;
import org.apache.struts2.util.PrefixTrie;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.regex.Pattern;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* <!-- START SNIPPET: javadoc -->
@@ -160,8 +162,6 @@ import java.util.regex.Pattern;
*/
public class DefaultActionMapper implements ActionMapper {
private static final Logger LOG = LoggerFactory.getLogger(DefaultActionMapper.class);
protected static final String METHOD_PREFIX = "method:";
protected static final String ACTION_PREFIX = "action:";
protected static final String REDIRECT_PREFIX = "redirect:";
@@ -171,7 +171,6 @@ public class DefaultActionMapper implements ActionMapper {
protected boolean allowSlashesInActionNames = false;
protected boolean alwaysSelectFullNamespace = false;
protected PrefixTrie prefixTrie = null;
protected Pattern allowedActionNames = Pattern.compile("[a-zA-Z0-9._!/\\-]*");
protected List<String> extensions = new ArrayList<String>() {{
add("action");
@@ -261,11 +260,6 @@ public class DefaultActionMapper implements ActionMapper {
this.alwaysSelectFullNamespace = "true".equals(val);
}
@Inject(value = StrutsConstants.STRUTS_ALLOWED_ACTION_NAMES, required = false)
public void setAllowedActionNames(String allowedActionNames) {
this.allowedActionNames = Pattern.compile(allowedActionNames);
}
@Inject
public void setContainer(Container container) {
this.container = container;
@@ -301,7 +295,8 @@ public class DefaultActionMapper implements ActionMapper {
*
* @see org.apache.struts2.dispatcher.mapper.ActionMapper#getMapping(javax.servlet.http.HttpServletRequest)
*/
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
public ActionMapping getMapping(HttpServletRequest request,
ConfigurationManager configManager) {
ActionMapping mapping = new ActionMapping();
String uri = getUri(request);
@@ -314,13 +309,22 @@ public class DefaultActionMapper implements ActionMapper {
}
parseNameAndNamespace(uri, mapping, configManager);
handleSpecialParameters(request, mapping);
return parseActionName(mapping);
// if Action name is empty it can be a request to static resource, return null to handle that case
if (StringUtils.isEmpty(mapping.getName())) {
return null;
}
parseActionName(mapping);
return mapping;
}
protected ActionMapping parseActionName(ActionMapping mapping) {
if (mapping.getName() == null) {
return null;
return mapping;
}
if (allowDynamicMethodCalls) {
// handle "name!method" convention.
@@ -342,7 +346,8 @@ public class DefaultActionMapper implements ActionMapper {
* @param request The request
* @param mapping The action mapping
*/
public void handleSpecialParameters(HttpServletRequest request, ActionMapping mapping) {
public void handleSpecialParameters(HttpServletRequest request,
ActionMapping mapping) {
// handle special parameter prefixes.
Set<String> uniqueParameters = new HashSet<String>();
Map parameterMap = request.getParameterMap();
@@ -372,7 +377,8 @@ public class DefaultActionMapper implements ActionMapper {
* @param uri The uri
* @param mapping The action mapping to populate
*/
protected void parseNameAndNamespace(String uri, ActionMapping mapping, ConfigurationManager configManager) {
protected void parseNameAndNamespace(String uri, ActionMapping mapping,
ConfigurationManager configManager) {
String namespace, name;
int lastSlash = uri.lastIndexOf("/");
if (lastSlash == -1) {
@@ -415,7 +421,7 @@ public class DefaultActionMapper implements ActionMapper {
}
}
if (!allowSlashesInActionNames) {
if (!allowSlashesInActionNames && name != null) {
int pos = name.lastIndexOf('/');
if (pos > -1 && pos < name.length() - 1) {
name = name.substring(pos + 1);
@@ -423,32 +429,7 @@ public class DefaultActionMapper implements ActionMapper {
}
mapping.setNamespace(namespace);
mapping.setName(cleanupActionName(name));
}
/**
* Cleans up action name from suspicious characters
*
* @param rawActionName action name extracted from URI
* @return safe action name
*/
protected String cleanupActionName(final String rawActionName) {
if (allowedActionNames.matcher(rawActionName).matches()) {
return rawActionName;
} else {
if (LOG.isWarnEnabled()) {
LOG.warn("Action [#0] does not match allowed action names pattern [#1], cleaning it up!",
rawActionName, allowedActionNames);
}
String cleanActionName = rawActionName;
for(String chunk : allowedActionNames.split(rawActionName)) {
cleanActionName = cleanActionName.replace(chunk, "");
}
if (LOG.isDebugEnabled()) {
LOG.debug("Cleaned action name [#0]", cleanActionName);
}
return cleanActionName;
}
mapping.setName(name);
}
/**
@@ -22,17 +22,12 @@ package org.apache.struts2.dispatcher.ng.filter;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.dispatcher.ng.PrepareOperations;
import org.apache.struts2.dispatcher.ng.ExecuteOperations;
import org.apache.struts2.dispatcher.ng.InitOperations;
import org.apache.struts2.dispatcher.ng.PrepareOperations;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@@ -68,15 +63,15 @@ public class StrutsExecuteFilter implements StrutsStatics, Filter {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
if (excludeUrl(request)) {
chain.doFilter(request, response);
return;
}
if (excludeUrl(request)) {
chain.doFilter(request, response);
return;
}
// This is necessary since we need the dispatcher instance, which was created by the prepare filter
if (execute == null) {
lazyInit();
}
if (execute == null) {
lazyInit();
}
ActionMapping mapping = prepare.findActionMapping(request, response);
@@ -94,14 +89,13 @@ public class StrutsExecuteFilter implements StrutsStatics, Filter {
}
}
private boolean excludeUrl(HttpServletRequest request) {
return request.getAttribute(StrutsPrepareFilter.REQUEST_EXCLUDED_FROM_ACTION_MAPPING) != null;
}
private boolean excludeUrl(HttpServletRequest request) {
return request.getAttribute(StrutsPrepareFilter.REQUEST_EXCLUDED_FROM_ACTION_MAPPING) != null;
}
public void destroy() {
prepare = null;
execute = null;
filterConfig = null;
}
}
@@ -27,12 +27,7 @@ import org.apache.struts2.dispatcher.ng.ExecuteOperations;
import org.apache.struts2.dispatcher.ng.InitOperations;
import org.apache.struts2.dispatcher.ng.PrepareOperations;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@@ -46,28 +41,25 @@ import java.util.regex.Pattern;
public class StrutsPrepareAndExecuteFilter implements StrutsStatics, Filter {
protected PrepareOperations prepare;
protected ExecuteOperations execute;
protected List<Pattern> excludedPatterns = null;
protected List<Pattern> excludedPatterns = null;
public void init(FilterConfig filterConfig) throws ServletException {
InitOperations init = new InitOperations();
Dispatcher dispatcher = null;
try {
FilterHostConfig config = new FilterHostConfig(filterConfig);
init.initLogging(config);
dispatcher = init.initDispatcher(config);
Dispatcher dispatcher = init.initDispatcher(config);
init.initStaticContentLoader(config, dispatcher);
prepare = new PrepareOperations(filterConfig.getServletContext(), dispatcher);
execute = new ExecuteOperations(filterConfig.getServletContext(), dispatcher);
this.excludedPatterns = init.buildExcludedPatternsList(dispatcher);
this.excludedPatterns = init.buildExcludedPatternsList(dispatcher);
postInit(dispatcher, filterConfig);
} finally {
if (dispatcher != null) {
dispatcher.cleanUpAfterInit();
}
init.cleanup();
}
}
/**
@@ -85,20 +77,20 @@ public class StrutsPrepareAndExecuteFilter implements StrutsStatics, Filter {
prepare.setEncodingAndLocale(request, response);
prepare.createActionContext(request, response);
prepare.assignDispatcherToThread();
if (excludedPatterns != null && prepare.isUrlExcluded(request, excludedPatterns)) {
chain.doFilter(request, response);
} else {
request = prepare.wrapRequest(request);
ActionMapping mapping = prepare.findActionMapping(request, response, true);
if (mapping == null) {
boolean handled = execute.executeStaticResourceRequest(request, response);
if (!handled) {
chain.doFilter(request, response);
}
} else {
execute.executeAction(request, response, mapping);
}
}
if ( excludedPatterns != null && prepare.isUrlExcluded(request, excludedPatterns)) {
chain.doFilter(request, response);
} else {
request = prepare.wrapRequest(request);
ActionMapping mapping = prepare.findActionMapping(request, response, true);
if (mapping == null) {
boolean handled = execute.executeStaticResourceRequest(request, response);
if (!handled) {
chain.doFilter(request, response);
}
} else {
execute.executeAction(request, response, mapping);
}
}
} finally {
prepare.cleanupRequest(request);
}
@@ -107,5 +99,4 @@ public class StrutsPrepareAndExecuteFilter implements StrutsStatics, Filter {
public void destroy() {
prepare.cleanupDispatcher();
}
}
@@ -25,12 +25,7 @@ import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.dispatcher.ng.InitOperations;
import org.apache.struts2.dispatcher.ng.PrepareOperations;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@@ -42,27 +37,23 @@ import java.util.regex.Pattern;
*/
public class StrutsPrepareFilter implements StrutsStatics, Filter {
protected static final String REQUEST_EXCLUDED_FROM_ACTION_MAPPING = StrutsPrepareFilter.class.getName() + ".REQUEST_EXCLUDED_FROM_ACTION_MAPPING";
protected static final String REQUEST_EXCLUDED_FROM_ACTION_MAPPING = StrutsPrepareFilter.class.getName() + ".REQUEST_EXCLUDED_FROM_ACTION_MAPPING";
protected PrepareOperations prepare;
protected List<Pattern> excludedPatterns = null;
protected List<Pattern> excludedPatterns = null;
public void init(FilterConfig filterConfig) throws ServletException {
public void init(FilterConfig filterConfig) throws ServletException {
InitOperations init = new InitOperations();
Dispatcher dispatcher = null;
try {
FilterHostConfig config = new FilterHostConfig(filterConfig);
init.initLogging(config);
dispatcher = init.initDispatcher(config);
Dispatcher dispatcher = init.initDispatcher(config);
prepare = new PrepareOperations(filterConfig.getServletContext(), dispatcher);
this.excludedPatterns = init.buildExcludedPatternsList(dispatcher);
this.excludedPatterns = init.buildExcludedPatternsList(dispatcher);
postInit(dispatcher, filterConfig);
} finally {
if (dispatcher != null) {
dispatcher.cleanUpAfterInit();
}
init.cleanup();
}
}
@@ -82,20 +73,19 @@ public class StrutsPrepareFilter implements StrutsStatics, Filter {
prepare.setEncodingAndLocale(request, response);
prepare.createActionContext(request, response);
prepare.assignDispatcherToThread();
if (excludedPatterns != null && prepare.isUrlExcluded(request, excludedPatterns)) {
request.setAttribute(REQUEST_EXCLUDED_FROM_ACTION_MAPPING, new Object());
} else {
request = prepare.wrapRequest(request);
prepare.findActionMapping(request, response);
}
if ( excludedPatterns != null && prepare.isUrlExcluded(request, excludedPatterns)) {
request.setAttribute(REQUEST_EXCLUDED_FROM_ACTION_MAPPING, new Object());
} else {
request = prepare.wrapRequest(request);
prepare.findActionMapping(request, response);
}
chain.doFilter(request, response);
} finally {
prepare.cleanupRequest(request);
}
}
public void destroy() {
public void destroy() {
prepare.cleanupDispatcher();
}
}
@@ -20,6 +20,8 @@
*/
package org.apache.struts2.dispatcher.ng.listener;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.dispatcher.ng.InitOperations;
@@ -32,26 +34,22 @@ import javax.servlet.ServletContextListener;
* Servlet listener for Struts. The preferred way to use Struts is as a filter via the
* {@link org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter} and its variants.
* This might be useful if Struts config information is needed from other servlet listeners, like
* Sitemesh or OSGi
* Sitemesh or OSGi
*/
public class StrutsListener implements ServletContextListener {
private PrepareOperations prepare;
public void contextInitialized(ServletContextEvent sce) {
InitOperations init = new InitOperations();
Dispatcher dispatcher = null;
InitOperations init = new InitOperations();
try {
ListenerHostConfig config = new ListenerHostConfig(sce.getServletContext());
init.initLogging(config);
dispatcher = init.initDispatcher(config);
Dispatcher dispatcher = init.initDispatcher(config);
init.initStaticContentLoader(config, dispatcher);
prepare = new PrepareOperations(config.getServletContext(), dispatcher);
sce.getServletContext().setAttribute(StrutsStatics.SERVLET_DISPATCHER, dispatcher);
} finally {
if (dispatcher != null) {
dispatcher.cleanUpAfterInit();
}
init.cleanup();
}
}
@@ -21,16 +21,15 @@
package org.apache.struts2.dispatcher.ng.servlet;
import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.dispatcher.ng.ExecuteOperations;
import org.apache.struts2.dispatcher.ng.InitOperations;
import org.apache.struts2.dispatcher.ng.PrepareOperations;
import org.apache.struts2.dispatcher.ng.ExecuteOperations;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.*;
import java.io.IOException;
/**
@@ -47,19 +46,15 @@ public class StrutsServlet extends HttpServlet {
@Override
public void init(ServletConfig filterConfig) throws ServletException {
InitOperations init = new InitOperations();
Dispatcher dispatcher = null;
try {
ServletHostConfig config = new ServletHostConfig(filterConfig);
init.initLogging(config);
dispatcher = init.initDispatcher(config);
Dispatcher dispatcher = init.initDispatcher(config);
init.initStaticContentLoader(config, dispatcher);
prepare = new PrepareOperations(filterConfig.getServletContext(), dispatcher);
execute = new ExecuteOperations(filterConfig.getServletContext(), dispatcher);
} finally {
if (dispatcher != null) {
dispatcher.cleanUpAfterInit();
}
init.cleanup();
}
}
@@ -89,5 +84,4 @@ public class StrutsServlet extends HttpServlet {
public void destroy() {
prepare.cleanupDispatcher();
}
}
@@ -57,7 +57,7 @@ import java.util.regex.Pattern;
* If cookiesValue is left empty it will assume that all cookie that match the cookieName
* parameter will be injected into Struts' action.<p/>
*
* The action could implement {@link CookiesAware} in order to have a {@link Map}
* The action could implements {@link CookiesAware} in order to have a {@link Map}
* of filtered cookies set into it. <p/>
*
* <!-- END SNIPPET: description -->
@@ -86,14 +86,10 @@ import java.util.regex.Pattern;
* <!-- START SNIPPET: extending -->
*
* <ul>
* <li>
* populateCookieValueIntoStack - this method will decide if this cookie value is qualified
* to be populated into the value stack (hence into the action itself)
* </li>
* <li>
* injectIntoCookiesAwareAction - this method will inject selected cookies (as a java.util.Map)
* into action that implements {@link CookiesAware}.
* </li>
* populateCookieValueIntoStack - this method will decide if this cookie value is qualified to be
* populated into the value stack (hence into the action itself)
* injectIntoCookiesAwareAction - this method will inject selected cookies (as a java.util.Map) into
* action that implements {@link CookiesAware}.
* </ul>
*
* <!-- END SNIPPET: extending -->
@@ -1,41 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor;
import javax.servlet.http.Cookie;
import java.util.Set;
/**
* Action can create cookies which will be stored in response
*
* @see CookieProviderInterceptor
*/
public interface CookieProvider {
/**
* Return cookies which should be send to client
*
* @return set of cookies or null
*/
Set<Cookie> getCookies();
}
@@ -1,115 +0,0 @@
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. 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. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.opensymphony.xwork2.interceptor.PreResultListener;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsStatics;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import java.util.Set;
/**
* <!-- START SNIPPET: description -->
* Allows actions to send cookies to client, action must implement {@link CookieProvider}
* You must reference this interceptor in your default stack or in action's stack, see example below.
*
* <!-- END SNIPPET: description -->
*
* <!-- START SNIPPET: parameters -->
*
* none
*
* <!-- END SNIPPET: parameters -->
*
* <!-- START SNIPPET: extending -->
*
* <ul>
* <li>addCookiesToResponse - this method applies cookie created by action to response</li>
* </ul>
*
* <!-- END SNIPPET: extending -->
*
* <pre>
* <!-- START SNIPPET: example -->
*
* &lt;action ... &gt;
* &lt;interceptor-ref name="defaultStack"/&gt;
* &lt;interceptor-ref name="cookieProvider"/&gt;
* ...
* &lt;/action&gt;
*
* <!-- END SNIPPET: example -->
* </pre>
*/
public class CookieProviderInterceptor extends AbstractInterceptor implements PreResultListener {
private static final Logger LOG = LoggerFactory.getLogger(CookieProviderInterceptor.class);
public String intercept(ActionInvocation invocation) throws Exception {
invocation.addPreResultListener(this);
return invocation.invoke();
}
/**
* Do what name suggests
*
* @param action {@link CookieProvider} action
* @param response current {@link HttpServletResponse}
*/
protected void addCookiesToResponse(CookieProvider action, HttpServletResponse response) {
Set<Cookie> cookies = action.getCookies();
if (cookies != null) {
for (Cookie cookie : cookies) {
if (LOG.isDebugEnabled()) {
LOG.debug("Sending cookie [#0] with value [#1] for domain [#2]",
cookie.getName(), cookie.getValue(), (cookie.getDomain() != null ? cookie.getDomain() : "no domain"));
}
response.addCookie(cookie);
}
}
}
public void beforeResult(ActionInvocation invocation, String resultCode) {
try {
if (LOG.isTraceEnabled()) {
LOG.trace("beforeResult start");
}
ActionContext ac = invocation.getInvocationContext();
if (invocation.getAction() instanceof CookieProvider) {
HttpServletResponse response = (HttpServletResponse) ac.get(StrutsStatics.HTTP_RESPONSE);
addCookiesToResponse((CookieProvider) invocation.getAction(), response);
}
if (LOG.isTraceEnabled()) {
LOG.trace("beforeResult end");
}
} catch (Exception ex) {
LOG.error("Unable to setup cookies", ex);
}
}
}
@@ -23,17 +23,6 @@ package org.apache.struts2.interceptor;
import java.util.Map;
/**
* Actions implementing the CookiesAware interface will receive
* a Map of filtered cookies via the setCookiesMap method.
*
* Please note that the {@link CookieInterceptor} needs to be
* activated to receive a cookies map.
*/
public interface CookiesAware {
/**
* Sets a map of filtered cookies.
* @param cookies the cookies
*/
void setCookiesMap(Map<String, String> cookies);
}
@@ -137,6 +137,7 @@ public class TokenSessionStoreInterceptor extends TokenInterceptor {
if (savedInvocation != null) {
// set the valuestack to the request scope
ValueStack stack = savedInvocation.getStack();
Map context = stack.getContext();
request.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack);
ActionContext savedContext = savedInvocation.getInvocationContext();
@@ -21,14 +21,14 @@
package org.apache.struts2.util;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.util.ValueStack;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.util.ValueStack;
/**
* InvocationSessionStore
@@ -62,7 +62,7 @@ public class InvocationSessionStore {
ValueStack stack = invocationContext.invocation.getStack();
ActionContext.getContext().setValueStack(stack);
return invocationContext.invocation.deserialize(ActionContext.getContext());
return invocationContext.invocation;
}
/**
@@ -73,7 +73,7 @@ public class InvocationSessionStore {
* @param invocation
*/
public static void storeInvocation(String key, String token, ActionInvocation invocation) {
InvocationContext invocationContext = new InvocationContext(invocation.serialize(), token);
InvocationContext invocationContext = new InvocationContext(invocation, token);
Map invocationMap = getInvocationMap();
invocationMap.put(key, invocationContext);
setInvocationMap(invocationMap);
@@ -2,14 +2,12 @@ package org.apache.struts2.util.fs;
import com.opensymphony.xwork2.util.fs.DefaultFileManager;
import com.opensymphony.xwork2.util.fs.FileRevision;
import com.opensymphony.xwork2.util.fs.JarEntryRevision;
import com.opensymphony.xwork2.util.fs.Revision;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
@@ -47,7 +45,7 @@ public class JBossFileManager extends DefaultFileManager {
return true;
} catch (ClassNotFoundException e) {
if (LOG.isDebugEnabled()) {
LOG.debug("Cannot load [#0] class, not a JBoss 5!", VFS_JBOSS5);
LOG.debug("Cannot load [#0] class, not a JBoss 5!", VFS_JBOSS7);
}
return false;
}
@@ -72,18 +70,7 @@ public class JBossFileManager extends DefaultFileManager {
if (LOG.isDebugEnabled()) {
LOG.debug("Creating revision for URL: " + fileName);
}
URL normalizedUrl = normalizeToFileProtocol(fileUrl);
if (LOG.isDebugEnabled()) {
LOG.debug("Normalized URL for [#0] is [#1]", fileName, normalizedUrl.toString());
}
Revision revision;
if ("file".equals(normalizedUrl.getProtocol())) {
revision = FileRevision.build(normalizedUrl);
} else if ("jar".equals(normalizedUrl.getProtocol())) {
revision = JarEntryRevision.build(normalizedUrl);
} else {
revision = Revision.build(normalizedUrl);
}
Revision revision = FileRevision.build(normalizeToFileProtocol(fileUrl));
files.put(fileName, revision);
} else {
super.monitorFile(fileUrl);
@@ -135,71 +122,43 @@ public class JBossFileManager extends DefaultFileManager {
*/
protected URL getJBossPhysicalUrl(URL url) throws IOException {
Object content = url.openConnection().getContent();
String classContent = content.getClass().toString();
if (LOG.isDebugEnabled()) {
LOG.debug("Reading physical URL for [#0]", url.toString());
}
if (classContent.startsWith("class org.jboss.vfs.VirtualFile")) { // JBoss 7 and probably 6
File physicalFile = readJBossPhysicalFile(content);
return physicalFile.toURI().toURL();
} else if (classContent.startsWith("class org.jboss.virtual.VirtualFile")) { // JBoss 5
return readJBoss5Url(content);
try {
String s = content.getClass().toString();
if (s.startsWith("class org.jboss.vfs.VirtualFile")) { // JBoss 7 and probably 6
File physicalFile = readJBossPhysicalFile(content);
return physicalFile.toURI().toURL();
} else if (s.startsWith("class org.jboss.virtual.VirtualFile")) { // JBoss 5
String fileName = url.toExternalForm();
return new URL("file", null, fileName.substring(fileName.indexOf(":") + 1));
}
} catch (Exception e) {
LOG.warn("Error calling getPhysicalFile() on JBoss VirtualFile.", e);
}
return url;
}
private File readJBossPhysicalFile(Object content) throws Exception {
Method method = content.getClass().getDeclaredMethod("getPhysicalFile");
return (File) method.invoke(content);
}
private List<URL> getAllJBossPhysicalUrls(URL url) throws IOException {
List<URL> urls = new ArrayList<URL>();
Object content = url.openConnection().getContent();
String classContent = content.getClass().toString();
if (classContent.startsWith("class org.jboss.vfs.VirtualFile")) {
File physicalFile = readJBossPhysicalFile(content);
if (physicalFile != null) {
try {
if (content.getClass().toString().startsWith("class org.jboss.vfs.VirtualFile")) {
File physicalFile = readJBossPhysicalFile(content);
readFile(urls, physicalFile);
readFile(urls, physicalFile.getParentFile());
} else {
urls.add(url);
}
} else if (classContent.startsWith("class org.jboss.virtual.VirtualFile")) {
URL physicalUrl = readJBoss5Url(content);
if (physicalUrl != null) {
urls.add(physicalUrl);
}
} else {
urls.add(url);
} catch (Exception e) {
LOG.warn("Error calling getPhysicalFile() on JBoss VirtualFile!", e);
}
return urls;
}
private File readJBossPhysicalFile(Object content) {
try {
Method method = content.getClass().getDeclaredMethod("getPhysicalFile");
return (File) method.invoke(content);
} catch (NoSuchMethodException e) {
LOG.error("Provided class content [#0] is not a JBoss VirtualFile, getPhysicalFile() method not found!", e, content.getClass().getSimpleName());
} catch (InvocationTargetException e) {
LOG.error("Cannot invoke getPhysicalFile() method!", e);
} catch (IllegalAccessException e) {
LOG.error("Cannot access getPhysicalFile() method!", e);
}
return null;
}
private URL readJBoss5Url(Object content) {
try {
Method method = content.getClass().getDeclaredMethod("getHandler");
method.setAccessible(true);
Object handler = method.invoke(content);
method = handler.getClass().getMethod("getRealURL");
return (URL) method.invoke(handler);
} catch (NoSuchMethodException e) {
LOG.error("Provided class content [#0] is not a JBoss VirtualFile, getHandler() or getRealURL() method not found!", e, content.getClass().getSimpleName());
} catch (InvocationTargetException e) {
LOG.error("Cannot invoke getHandler() or getRealURL() method!", e);
} catch (IllegalAccessException e) {
LOG.error("Cannot access getHandler() or getRealURL() method!", e);
}
return null;
}
private void readFile(List<URL> urls, File physicalFile) throws MalformedURLException {
File[] files = physicalFile.listFiles();
if (physicalFile.isDirectory() && files != null) {
@@ -26,8 +26,6 @@ import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.LocaleProvider;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import freemarker.template.Configuration;
import freemarker.template.ObjectWrapper;
import freemarker.template.Template;
@@ -105,8 +103,6 @@ public class FreemarkerResult extends StrutsResultSupport {
private static final long serialVersionUID = -3778230771704661631L;
private static final Logger LOG = LoggerFactory.getLogger(FreemarkerResult.class);
protected ActionInvocation invocation;
protected Configuration configuration;
protected ObjectWrapper wrapper;
@@ -195,16 +191,6 @@ public class FreemarkerResult extends StrutsResultSupport {
parentCharArrayWriter.flush();
parentCharArrayWriter.writeTo(writer);
}
} catch (TemplateException e) {
if (LOG.isErrorEnabled()) {
LOG.error("Error processing Freemarker result!", e);
}
throw e;
} catch (IOException e) {
if (LOG.isErrorEnabled()){
LOG.error("Error processing Freemarker result!", e);
}
throw e;
} finally {
if (isTopTemplate && parentCharArrayWriter != null) {
req.removeAttribute(PARENT_TEMPLATE_WRITER);
@@ -45,7 +45,7 @@ public abstract class AbstractUITag extends ComponentTagSupport implements Dynam
protected String label;
protected String labelSeparator;
protected String labelPosition;
protected String requiredPosition;
protected String requiredposition;
protected String errorPosition;
protected String name;
protected String requiredLabel;
@@ -97,7 +97,7 @@ public abstract class AbstractUITag extends ComponentTagSupport implements Dynam
uiBean.setLabel(label);
uiBean.setLabelSeparator(labelSeparator);
uiBean.setLabelposition(labelPosition);
uiBean.setRequiredPosition(requiredPosition);
uiBean.setRequiredPosition(requiredposition);
uiBean.setErrorPosition(errorPosition);
uiBean.setName(name);
uiBean.setRequiredLabel(requiredLabel);
@@ -169,8 +169,8 @@ public abstract class AbstractUITag extends ComponentTagSupport implements Dynam
this.labelPosition = labelPosition;
}
public void setRequiredPosition(String requiredPosition) {
this.requiredPosition = requiredPosition;
public void setRequiredposition(String requiredPosition) {
this.requiredposition = requiredPosition;
}
public void setErrorPosition(String errorPosition) {
@@ -241,45 +241,47 @@ public class DefaultUrlHelper implements UrlHelper {
private String buildParameterSubstring(String name, String value) {
StringBuilder builder = new StringBuilder();
builder.append(encode(name));
builder.append(translateAndEncode(name));
builder.append('=');
builder.append(encode(value));
builder.append(translateAndEncode(value));
return builder.toString();
}
/**
* Encodes the URL using {@link java.net.URLEncoder#encode} with the encoding specified in the configuration.
*
* @param input the input to encode
* @return the encoded string
*/
public String encode( String input ) {
try {
return URLEncoder.encode(input, encoding);
} catch (UnsupportedEncodingException e) {
if (LOG.isWarnEnabled()) {
LOG.warn("Could not encode URL parameter '#0', returning value un-encoded", input);
}
return input;
}
}
/**
* Translates any script expressions using {@link com.opensymphony.xwork2.util.TextParseUtil#translateVariables} and
* encodes the URL using {@link java.net.URLEncoder#encode} with the encoding specified in the configuration.
*
* @param input
* @return the translated and encoded string
*/
public String translateAndEncode(String input) {
String translatedInput = translateVariable(input);
try {
return URLEncoder.encode(translatedInput, encoding);
} catch (UnsupportedEncodingException e) {
if (LOG.isWarnEnabled()) {
LOG.warn("Could not encode URL parameter '#0', returning value un-encoded", input);
}
return translatedInput;
}
}
/**
* Decodes the URL using {@link java.net.URLDecoder#decode(String, String)} with the encoding specified in the configuration.
*
* @param input the input to decode
* @return the encoded string
*/
public String decode( String input ) {
try {
return URLDecoder.decode(input, encoding);
} catch (UnsupportedEncodingException e) {
if (LOG.isWarnEnabled()) {
LOG.warn("Could not decode URL parameter '#0', returning value un-decoded", input);
}
return input;
}
}
public String translateAndDecode(String input) {
String translatedInput = translateVariable(input);
try {
return URLDecoder.decode(translatedInput, encoding);
} catch (UnsupportedEncodingException e) {
if (LOG.isWarnEnabled()) {
LOG.warn("Could not encode URL parameter '#0', returning value un-encoded", input);
}
return translatedInput;
}
}
private String translateVariable(String input) {
ValueStack valueStack = ServletActionContext.getContext().getValueStack();
return TextParseUtil.translateVariables(input, valueStack);
}
public Map<String, Object> parseQueryString(String queryString, boolean forceValueArray) {
Map<String, Object> queryParams = new LinkedHashMap<String, Object>();
@@ -297,8 +299,8 @@ public class DefaultUrlHelper implements UrlHelper {
paramValue = tmpParams[1];
}
if (paramName != null) {
paramName = decode(paramName);
String translatedParamValue = decode(paramValue);
paramName = translateAndDecode(paramName);
String translatedParamValue = translateAndDecode(paramValue);
if (queryParams.containsKey(paramName) || forceValueArray) {
// WW-1619 append new param value to existing value(s)
@@ -238,9 +238,6 @@ public class XSLTResult implements Result {
/** Indicates the ognl expression respresenting the bean which is to be exposed as xml. */
private String exposedValue;
/** Indicates the status to return in the response */
private int status = 200;
private boolean parse;
private AdapterFactory adapterFactory;
@@ -310,18 +307,6 @@ public class XSLTResult implements Result {
this.excludingPattern = excludingPattern;
}
public String getStatus() {
return String.valueOf(status);
}
public void setStatus(String status) {
try {
this.status = Integer.valueOf(status);
} catch (NumberFormatException e) {
throw new IllegalArgumentException("Status value not number " + e.getMessage(), e);
}
}
/**
* If true, parse the stylesheet location for OGNL expressions.
*
@@ -343,7 +328,7 @@ public class XSLTResult implements Result {
try {
HttpServletResponse response = ServletActionContext.getResponse();
response.setStatus(status);
PrintWriter writer = response.getWriter();
// Create a transformer for the stylesheet.
@@ -100,8 +100,6 @@
<bean class="com.opensymphony.xwork2.ognl.OgnlUtil" />
<bean type="com.opensymphony.xwork2.util.TextParser" name="struts" class="com.opensymphony.xwork2.util.OgnlTextParser" scope="singleton"/>
<bean type="ognl.PropertyAccessor" name="com.opensymphony.xwork2.util.CompoundRoot" class="com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor" />
<bean type="ognl.PropertyAccessor" name="java.lang.Object" class="com.opensymphony.xwork2.ognl.accessor.ObjectAccessor" />
<bean type="ognl.PropertyAccessor" name="java.util.Iterator" class="com.opensymphony.xwork2.ognl.accessor.XWorkIteratorPropertyAccessor" />
@@ -145,7 +143,6 @@
<interceptor name="chain" class="com.opensymphony.xwork2.interceptor.ChainingInterceptor"/>
<interceptor name="conversionError" class="org.apache.struts2.interceptor.StrutsConversionErrorInterceptor"/>
<interceptor name="cookie" class="org.apache.struts2.interceptor.CookieInterceptor"/>
<interceptor name="cookieProvider" class="org.apache.struts2.interceptor.CookieProviderInterceptor"/>
<interceptor name="clearSession" class="org.apache.struts2.interceptor.ClearSessionInterceptor" />
<interceptor name="createSession" class="org.apache.struts2.interceptor.CreateSessionInterceptor" />
<interceptor name="debugging" class="org.apache.struts2.interceptor.debugging.DebuggingInterceptor" />
@@ -47,11 +47,11 @@
class="checkboxLabel"<#rt/>
</#if>
>
<#if parameters.required?default(false) && parameters.requiredPosition?default("right") != 'right'>
<#if parameters.required?default(false) && parameters.requiredposition?default("right") != 'right'>
<span class="required">*</span><#t/>
</#if>
${parameters.label?html}<#t/>
<#if parameters.required?default(false) && parameters.requiredPosition?default("right") == 'right'>
<#if parameters.required?default(false) && parameters.requiredposition?default("right") == 'right'>
<span class="required">*</span><#t/>
</#if>
:<#t/>
@@ -79,11 +79,11 @@ ${parameters.label?html}<#t/>
class="checkboxLabel"<#rt/>
</#if>
>
<#if parameters.required?default(false) && parameters.requiredPosition?default("right") != 'right'>
<#if parameters.required?default(false) && parameters.requiredposition?default("right") != 'right'>
<span class="required">*</span><#t/>
</#if>
${parameters.label?html}<#t/>
<#if parameters.required?default(false) && parameters.requiredPosition?default("right") == 'right'>
<#if parameters.required?default(false) && parameters.requiredposition?default("right") == 'right'>
<span class="required">*</span><#t/>
</#if>
:<#t/>
@@ -57,11 +57,11 @@
class="label"<#t/>
</#if>
><#t/>
<#if parameters.required?default(false) && parameters.requiredPosition?default("right") != 'right'>
<#if parameters.required?default(false) && parameters.requiredposition?default("right") != 'right'>
<span class="required">*</span><#t/>
</#if>
${parameters.label?html}<#t/>
<#if parameters.required?default(false) && parameters.requiredPosition?default("right") == 'right'>
<#if parameters.required?default(false) && parameters.requiredposition?default("right") == 'right'>
<span class="required">*</span><#t/>
</#if>
${parameters.labelseparator?default(":")?html}<#t/>
@@ -33,29 +33,9 @@ Only the following validators are supported:
* double validator
END SNIPPET: supported-validators
-->
<#if ((parameters.validate!false == true) && (parameters.performValidation!false == true))>
<#if ((parameters.validate?default(false) == true) && (parameters.performValidation?default(false) == true))>
<script type="text/javascript">
function validateForm_${parameters.id?replace('[^a-zA-Z0-9_]', '_', 'r')}() {
<#--
In case of multiselect fields return only the first value.
-->
var getFieldValue = function(field) {
var type = field.type ? field.type : field[0].type;
if (type == 'select-one' || type == 'select-multiple') {
return (field.selectedIndex == -1 ? "" : field.options[field.selectedIndex].value);
} else if (type == 'checkbox' || type == 'radio') {
if (!field.length) {
field = [field];
}
for (var i = 0; i < field.length; i++) {
if (field[i].checked) {
return field[i].value;
}
}
return "";
}
return field.value;
}
form = document.getElementById("${parameters.id}");
clearErrorMessages(form);
clearErrorLabels(form);
@@ -63,36 +43,27 @@ END SNIPPET: supported-validators
var errors = false;
var continueValidation = true;
<#list parameters.tagNames as tagName>
<#list tag.getValidators("${tagName}") as aValidator>
// field name: ${aValidator.fieldName}
// validator name: ${aValidator.validatorType}
if (form.elements['${aValidator.fieldName}']) {
field = form.elements['${aValidator.fieldName}'];
<#if aValidator.validatorType = "field-visitor">
<#assign validator = aValidator.fieldValidator >
//visitor validator switched to: ${validator.validatorType}
<#else>
<#assign validator = aValidator >
</#if>
<#list tag.getValidators("${tagName}") as validator>
// field name: ${validator.fieldName}
// validator name: ${validator.validatorType}
if (form.elements['${validator.fieldName}']) {
field = form.elements['${validator.fieldName}'];
var error = "${validator.getMessage(action)?js_string}";
var fieldValue = getFieldValue(field);
<#if validator.validatorType = "required">
if (fieldValue == "") {
if (field.value == "") {
addError(field, error);
errors = true;
<#if validator.shortCircuit>continueValidation = false;</#if>
}
<#elseif validator.validatorType = "requiredstring">
if (continueValidation && fieldValue != null && (fieldValue == "" || fieldValue.replace(/^\s+|\s+$/g,"").length == 0)) {
if (continueValidation && field.value != null && (field.value == "" || field.value.replace(/^\s+|\s+$/g,"").length == 0)) {
addError(field, error);
errors = true;
<#if validator.shortCircuit>continueValidation = false;</#if>
}
<#elseif validator.validatorType = "stringlength">
if (continueValidation && fieldValue != null) {
var value = fieldValue;
if (continueValidation && field.value != null) {
var value = field.value;
<#if validator.trim>
//trim field value
while (value.substring(0,1) == ' ')
@@ -108,28 +79,28 @@ END SNIPPET: supported-validators
}
}
<#elseif validator.validatorType = "regex">
if (continueValidation && fieldValue != null && !fieldValue.match("${validator.regex?js_string}")) {
if (continueValidation && field.value != null && !field.value.match("${validator.expression?js_string}")) {
addError(field, error);
errors = true;
<#if validator.shortCircuit>continueValidation = false;</#if>
}
<#elseif validator.validatorType = "email">
if (continueValidation && fieldValue != null && fieldValue.length > 0 && fieldValue.match("${validator.regex?js_string}")==null) {
if (continueValidation && field.value != null && field.value.length > 0 && field.value.match("${validator.expression?js_string}")==null) {
addError(field, error);
errors = true;
<#if validator.shortCircuit>continueValidation = false;</#if>
}
<#elseif validator.validatorType = "url">
if (continueValidation && fieldValue != null && fieldValue.length > 0 && fieldValue.match("${validator.regex?js_string}")==null) {
if (continueValidation && field.value != null && field.value.length > 0 && field.value.match(/^(ftp|http|https):\/\/((%[A-F0-9]{2}|[A-Z0-9-._~!$&'()*+,;=:])+@)?((%[A-F0-9]{2}|[A-Z0-9-._~!$&'()*+,;=])+)(:[0-9]+)?((\/(%[A-F0-9]{2}|[A-Z0-9-._~!$&'()*+,;=:@])*)*)(\?(%[A-F0-9]{2}|[A-Z0-9-._~!$&'()*+,;=:@/?])*)?(#(%[A-F0-9]{2}|[A-Z0-9-._~!$&'()*+,;=:@/?])*)?$/gi)==null) {
addError(field, error);
errors = true;
<#if validator.shortCircuit>continueValidation = false;</#if>
}
<#elseif validator.validatorType = "int" || validator.validatorType = "short">
if (continueValidation && fieldValue != null) {
if (<#if validator.min??>parseInt(fieldValue) <
<#elseif validator.validatorType = "int">
if (continueValidation && field.value != null) {
if (<#if validator.min??>parseInt(field.value) <
${validator.min?c}<#else>false</#if> ||
<#if validator.max??>parseInt(fieldValue) >
<#if validator.max??>parseInt(field.value) >
${validator.max?c}<#else>false</#if>) {
addError(field, error);
errors = true;
@@ -137,14 +108,15 @@ END SNIPPET: supported-validators
}
}
<#elseif validator.validatorType = "double">
if (continueValidation && fieldValue != null) {
var value = parseFloat(fieldValue);
if (continueValidation && field.value != null) {
var value = parseFloat(field.value);
if (<#if validator.minInclusive??>value < ${validator.minInclusive?c}<#else>false</#if> ||
<#if validator.maxInclusive??>value > ${validator.maxInclusive?c}<#else>false</#if> ||
<#if validator.minExclusive??>value <= ${validator.minExclusive?c}<#else>false</#if> ||
<#if validator.maxExclusive??>value >= ${validator.maxExclusive?c}<#else>false</#if>) {
addError(field, error);
errors = true;
<#if validator.shortCircuit>continueValidation = false;</#if>
}
}
</#if>
@@ -155,4 +127,4 @@ END SNIPPET: supported-validators
return !errors;
}
</script>
</#if>
</#if>
+2 -3
View File
@@ -29,8 +29,8 @@
</bannerLeft>
<bannerRight>
<name>Apache Struts</name>
<src>http://struts.apache.org/images/struts.gif</src>
<href>http://struts.apache.org/</href>
<src>images/struts2.png</src>
<href>http://struts.apache.org/2.x/index.html</href>
</bannerRight>
<body>
<links>
@@ -40,7 +40,6 @@
href="http://struts.apache.org/index.html"/>
</links>
<menu ref="parent"/>
<menu ref="reports"/>
</body>
@@ -1,47 +0,0 @@
package org.apache.struts2;
import com.opensymphony.xwork2.inject.Container;
import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import java.util.HashMap;
/**
* Test class instantiation with Container
*/
public class ClassInstantiationTest extends StrutsTestCase {
public void testCompositeActionMapperInstantiationWithList() throws Exception {
// given
Dispatcher du = initDispatcher(new HashMap<String, String>() {{
put(StrutsConstants.STRUTS_I18N_ENCODING, "utf-8");
put(StrutsConstants.STRUTS_MAPPER_COMPOSITE, "struts,restful");
}});
Container container = du.getContainer();
// when
ActionMapper instance = container.getInstance(ActionMapper.class, "composite");
// then
assertNotNull(instance);
}
public void testCompositeActionMapperInstantiationWithoutList() throws Exception {
// given
Dispatcher du = initDispatcher(new HashMap<String, String>() {{
put(StrutsConstants.STRUTS_I18N_ENCODING, "utf-8");
}});
Container container = du.getContainer();
// when
try {
container.getInstance(ActionMapper.class, "composite");
fail();
}catch (Exception e) {
// then
// You cannot use CompositeActionMapper without defined list of "struts.mapper.composite"
assertTrue(e.getMessage().contains("No mapping found for dependency [type=java.lang.String, name='struts.mapper.composite']"));
}
}
}
@@ -21,17 +21,18 @@
package org.apache.struts2.components;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.validator.validators.RequiredFieldValidator;
import java.util.List;
import org.apache.struts2.TestAction;
import org.apache.struts2.views.jsp.AbstractUITagTest;
import org.easymock.EasyMock;
import java.util.List;
import com.opensymphony.xwork2.validator.validators.RequiredFieldValidator;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
/**
* <code>FormTest</code>
@@ -44,7 +45,6 @@ public class FormTest extends AbstractUITagTest {
Form form = new Form(stack, request, response);
container.inject(form);
form.getParameters().put("actionClass", TestAction.class);
form.setAction("actionName");
List v = form.getValidators("foo");
assertEquals(1, v.size());
assertEquals(RequiredFieldValidator.class, v.get(0).getClass());
@@ -21,14 +21,15 @@
package org.apache.struts2.components;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.ValueStack;
import java.util.Collections;
import java.util.Map;
import org.apache.struts2.StrutsTestCase;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import java.util.Collections;
import java.util.Map;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.ValueStack;
/**
*
@@ -84,21 +85,6 @@ public class UIBeanTest extends StrutsTestCase {
assertEquals("formId_txtFldName", txtFld.getParameters().get("id"));
}
public void testPopulateComponentHtmlWithoutNameAndId() throws Exception {
ValueStack stack = ActionContext.getContext().getValueStack();
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
Form form = new Form(stack, req, res);
form.getParameters().put("id", "formId");
TextField txtFld = new TextField(stack, req, res);
txtFld.populateComponentHtmlId(form);
assertEquals(null, txtFld.getParameters().get("id"));
}
public void testEscape() throws Exception {
ValueStack stack = ActionContext.getContext().getValueStack();
MockHttpServletRequest req = new MockHttpServletRequest();
@@ -157,7 +143,7 @@ public class UIBeanTest extends StrutsTestCase {
ValueStack stack = ActionContext.getContext().getValueStack();
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
Map context = Collections.singletonMap("theme", 12);
Map context = Collections.singletonMap("theme", new Integer(12));
ActionContext.getContext().put("attr", context);
TextField txtFld = new TextField(stack, req, res);
@@ -183,7 +183,6 @@ public class ServletRedirectResultTest extends StrutsTestCase implements StrutsS
.addParam("location", "someLocation")
.addParam("prependServletContext", "true")
.addParam("method", "someMethod")
.addParam("statusCode", "333")
.addParam("param1", "value 1")
.addParam("param2", "value 2")
.addParam("param3", "value 3")
@@ -222,6 +221,7 @@ public class ServletRedirectResultTest extends StrutsTestCase implements StrutsS
result.setActionMapper(container.getInstance(ActionMapper.class));
result.execute(mockInvocation);
assertEquals("/myNamespace/myAction.action?param1=value+1&param2=value+2&param3=value+3#fragment", res.getRedirectedUrl());
control.verify();
}
@@ -21,14 +21,23 @@
package org.apache.struts2.dispatcher.mapper;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.StrutsConstants;
import org.springframework.mock.web.MockHttpServletRequest;
import com.mockobjects.dynamic.C;
import com.mockobjects.dynamic.Mock;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.inject.Container;
import junit.framework.TestCase;
import org.springframework.mock.web.MockHttpServletRequest;
import com.opensymphony.xwork2.inject.Scope.Strategy;
import javax.servlet.http.HttpServletRequest;
import junit.framework.TestCase;
/**
*
@@ -36,12 +45,16 @@ import javax.servlet.http.HttpServletRequest;
*/
public class CompositeActionMapperTest extends TestCase {
CompositeActionMapper compositeActionMapper;
Mock mockContainer;
public void setUp() throws Exception {
compositeActionMapper = new CompositeActionMapper();
mockContainer = new Mock(Container.class);
compositeActionMapper.setContainer((Container)mockContainer.proxy());
}
public void testGetActionMappingAndUri1() throws Exception {
ActionMapper mapper1 = new InnerActionMapper1();
ActionMapper mapper2 = new InnerActionMapper2();
@@ -49,7 +62,7 @@ public class CompositeActionMapperTest extends TestCase {
mockContainer.expectAndReturn("getInstance", C.args(C.eq(ActionMapper.class), C.eq("mapper1")), mapper1);
mockContainer.expectAndReturn("getInstance", C.args(C.eq(ActionMapper.class), C.eq("mapper2")), mapper3);
mockContainer.expectAndReturn("getInstance", C.args(C.eq(ActionMapper.class), C.eq("mapper3")), mapper2);
CompositeActionMapper compositeActionMapper = new CompositeActionMapper((Container) mockContainer.proxy(), "mapper1,mapper2,mapper3");
compositeActionMapper.setActionMappers("mapper1,mapper2,mapper3");
ActionMapping actionMapping = compositeActionMapper.getMapping(new MockHttpServletRequest(), new ConfigurationManager());
String uri = compositeActionMapper.getUriFromActionMapping(new ActionMapping());
@@ -67,7 +80,7 @@ public class CompositeActionMapperTest extends TestCase {
ActionMapper mapper2 = new InnerActionMapper2();
mockContainer.expectAndReturn("getInstance", C.args(C.eq(ActionMapper.class), C.eq("mapper1")), mapper1);
mockContainer.expectAndReturn("getInstance", C.args(C.eq(ActionMapper.class), C.eq("mapper2")), mapper2);
CompositeActionMapper compositeActionMapper = new CompositeActionMapper((Container) mockContainer.proxy(), "mapper1,mapper2");
compositeActionMapper.setActionMappers("mapper1,mapper2");
ActionMapping actionMapping = compositeActionMapper.getMapping(new MockHttpServletRequest(), new ConfigurationManager());
String uri = compositeActionMapper.getUriFromActionMapping(new ActionMapping());
@@ -21,6 +21,17 @@
package org.apache.struts2.dispatcher.mapper;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.dispatcher.ServletRedirectResult;
import org.apache.struts2.dispatcher.StrutsResultSupport;
import org.apache.struts2.views.jsp.StrutsMockHttpServletRequest;
import org.apache.struts2.views.jsp.StrutsMockHttpServletResponse;
import com.mockobjects.dynamic.Mock;
import com.mockobjects.servlet.MockHttpServletRequest;
import com.opensymphony.xwork2.ActionContext;
@@ -30,16 +41,6 @@ import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.dispatcher.ServletRedirectResult;
import org.apache.struts2.dispatcher.StrutsResultSupport;
import org.apache.struts2.views.jsp.StrutsMockHttpServletRequest;
import org.apache.struts2.views.jsp.StrutsMockHttpServletResponse;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* DefaultActionMapper test case.
@@ -256,7 +257,8 @@ public class DefaultActionMapperTest extends StrutsTestCase {
public void testGetMappingWithActionName_null() throws Exception {
DefaultActionMapper mapper = new DefaultActionMapper();
ActionMapping mapping = mapper.getMappingFromActionName(null);
assertNull(mapping);
assertEquals(null, mapping.getName());
assertEquals(null, mapping.getMethod());
}
public void testGetUri() throws Exception {
@@ -747,29 +749,4 @@ public class DefaultActionMapperTest extends StrutsTestCase {
}
public void testAllowedActionNames() throws Exception {
DefaultActionMapper mapper = new DefaultActionMapper();
String actionName = "action";
assertEquals(actionName, mapper.cleanupActionName(actionName));
actionName = "${action}";
assertEquals("action", mapper.cleanupActionName(actionName));
actionName = "${${%{action}}}";
assertEquals("action", mapper.cleanupActionName(actionName));
actionName = "${#foo='action',#foo}";
assertEquals("fooactionfoo", mapper.cleanupActionName(actionName));
actionName = "test-action";
assertEquals("test-action", mapper.cleanupActionName(actionName));
actionName = "test_action";
assertEquals("test_action", mapper.cleanupActionName(actionName));
actionName = "test!bar.action";
assertEquals("test!bar.action", mapper.cleanupActionName(actionName));
}
}
@@ -1,55 +0,0 @@
package org.apache.struts2.interceptor;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.XWorkTestCase;
import org.easymock.EasyMock;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import java.util.HashSet;
import java.util.Set;
public class CookieProviderInterceptorTest extends XWorkTestCase {
public void testPreResultListenerAddition() throws Exception {
// given
ActionInvocation invocation = EasyMock.createNiceMock(ActionInvocation.class);
CookieProviderInterceptor interceptor = new CookieProviderInterceptor();
invocation.addPreResultListener(interceptor);
EasyMock.replay(invocation);
// when
interceptor.intercept(invocation);
// then
EasyMock.verify(invocation);
}
public void testCookieCreation() throws Exception {
// given
CookieProviderInterceptor interceptor = new CookieProviderInterceptor();
final Cookie cookie = new Cookie("foo", "bar");
CookieProvider action = new CookieProvider() {
public Set<Cookie> getCookies() {
Set<Cookie> cookies = new HashSet<Cookie>();
cookies.add(cookie);
return cookies;
}
};
HttpServletResponse response = EasyMock.createNiceMock(HttpServletResponse.class);
response.addCookie(cookie);
EasyMock.replay(response);
// when
interceptor.addCookiesToResponse(action, response);
// then
EasyMock.verify(response);
}
}
@@ -21,15 +21,17 @@
package org.apache.struts2.util;
import java.util.HashMap;
import java.util.Map;
import org.apache.struts2.StrutsTestCase;
import com.mockobjects.dynamic.Mock;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.StrutsTestCase;
import java.util.HashMap;
import java.util.Map;
import com.opensymphony.xwork2.util.ValueStackFactory;
/**
@@ -77,8 +79,6 @@ public class InvocationSessionStoreTest extends StrutsTestCase {
invocationMock = new Mock(ActionInvocation.class);
invocation = (ActionInvocation) invocationMock.proxy();
invocationMock.matchAndReturn("serialize", invocation);
invocationMock.matchAndReturn("deserialize", actionContext, invocation);
actionContext.setValueStack(stack);
invocationMock.matchAndReturn("getStack", stack);

Some files were not shown because too many files have changed in this diff Show More