Compare commits

..

4 Commits

Author SHA1 Message Date
Lukasz Lenart 12cc861875 [maven-release-plugin] prepare release STRUTS_2_5_4 2016-10-06 21:03:54 +02:00
Lukasz Lenart adeda4788b WW-4572 Updates JavaDocs 2016-10-06 20:56:34 +02:00
Lukasz Lenart bb403720ac WW-4572 Reverts ParameterAware interface to its previous version and introduces new one 2016-10-06 20:51:19 +02:00
Lukasz Lenart 67541e07a7 [maven-release-plugin] prepare for next development iteration 2016-10-05 07:44:55 +02:00
40 changed files with 119 additions and 49 deletions
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-apps</artifactId>
<packaging>pom</packaging>
+2 -2
View File
@@ -26,12 +26,12 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-rest-showcase</artifactId>
<packaging>war</packaging>
<version>2.5.3</version>
<version>2.5.4</version>
<name>Struts 2 Rest Showcase Webapp</name>
<description>Struts 2 Rest Showcase Example</description>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-showcase</artifactId>
+1 -1
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-assembly</artifactId>
+3 -3
View File
@@ -10,7 +10,7 @@
</parent>
<artifactId>struts2-bom</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
<packaging>pom</packaging>
<name>Struts 2 Bill of Materials</name>
@@ -25,7 +25,7 @@
</licenses>
<properties>
<struts-version.version>2.5.3</struts-version.version>
<struts-version.version>2.5.4</struts-version.version>
</properties>
<build>
@@ -172,6 +172,6 @@
</dependencyManagement>
<scm>
<tag>STRUTS_2_5_3</tag>
<tag>STRUTS_2_5_4</tag>
</scm>
</project>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-osgi-admin-bundle</artifactId>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-osgi-demo-bundle</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-osgi-bundles</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-core</artifactId>
<packaging>jar</packaging>
@@ -57,10 +57,10 @@ public class HttpParameters implements Cloneable {
return HttpParameters.createEmpty().withParent(this).withExtraParams(newParams).build();
}
public Map<String, Object> toMap() {
Map<String, Object> result = new HashMap<>(parameters.size());
public Map<String, String[]> toMap() {
Map<String, String[]> result = new HashMap<>(parameters.size());
for (Map.Entry<String, Parameter> entry : parameters.entrySet()) {
result.put(entry.getKey(), entry.getValue().getObject());
result.put(entry.getKey(), entry.getValue().getMultipleValues());
}
return result;
}
@@ -0,0 +1,47 @@
/*
* $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 org.apache.struts2.dispatcher.HttpParameters;
/**
* <p>
* This interface gives actions an alternative way of receiving input parameters. The parameters will
* contain all input parameters as implementation of {@link org.apache.struts2.dispatcher.Parameter}.
* Actions that need this should simply implement it.
* </p>
*
* <p>
* One common use for this is to have the action propagate parameters to internally instantiated data
* objects.
* </p>
*/
public interface HttpParametersAware {
/**
* Sets the HTTP parameters in the implementing class.
*
* @param parameters an instance of {@link HttpParameters}.
*/
void setParameters(HttpParameters parameters);
}
@@ -21,11 +21,8 @@
package org.apache.struts2.interceptor;
import org.apache.struts2.dispatcher.HttpParameters;
import java.util.Map;
/**
* <p>
* This interface gives actions an alternative way of receiving input parameters. The map will
@@ -41,7 +38,10 @@ import java.util.Map;
* Note that all parameter values for a given name will be returned, so the type of the objects in
* the map is <tt>java.lang.String[]</tt>.
* </p>
*
* @deprecated please use {@link HttpParametersAware} instead
*/
@Deprecated
public interface ParameterAware {
/**
@@ -49,5 +49,5 @@ public interface ParameterAware {
*
* @param parameters a Map of parameters (name/value Strings).
*/
public void setParameters(HttpParameters parameters);
public void setParameters(Map<String, String[]> parameters);
}
@@ -55,7 +55,9 @@ import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
*
* <li>{@link ServletResponseAware}</li>
*
* <li>{@link ParameterAware}</li>
* <li>{@link ParameterAware} - deprecated since 2.5.4, please use {@link HttpParametersAware}</li>
*
* <li>{@link HttpParametersAware}</li>
*
* <li>{@link RequestAware}</li>
*
@@ -105,6 +107,7 @@ import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
* @see ServletRequestAware
* @see ServletResponseAware
* @see ParameterAware
* @see HttpParametersAware
* @see SessionAware
* @see ApplicationAware
* @see PrincipalAware
@@ -135,7 +138,11 @@ public class ServletConfigInterceptor extends AbstractInterceptor implements Str
}
if (action instanceof ParameterAware) {
((ParameterAware) action).setParameters(context.getParameters());
((ParameterAware) action).setParameters(context.getParameters().toMap());
}
if (action instanceof HttpParametersAware) {
((HttpParametersAware) action).setParameters(context.getParameters());
}
if (action instanceof ApplicationAware) {
@@ -84,7 +84,23 @@ public class ServletConfigInterceptorTest extends StrutsInternalTestCase {
}
public void testParameterAware() throws Exception {
ParameterAware mock = (ParameterAware) createMock(ParameterAware.class);
ParameterAware mock = createMock(ParameterAware.class);
MockActionInvocation mai = createActionInvocation(mock);
HttpParameters param = HttpParameters.createEmpty().build();
mai.getInvocationContext().setParameters(param);
mock.setParameters(param.toMap());
expectLastCall().times(1);
replay(mock);
interceptor.intercept(mai);
verify(mock);
}
public void testHttpParametersAware() throws Exception {
HttpParametersAware mock = createMock(HttpParametersAware.class);
MockActionInvocation mai = createActionInvocation(mock);
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-cdi-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-config-browser-plugin</artifactId>
+1 -1
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-convention-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-dwr-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-embeddedjsp-plugin</artifactId>
+1 -1
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-gxp-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-jasperreports-plugin</artifactId>
+1 -1
View File
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-javatemplates-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-jfreechart-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-json-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-junit-plugin</artifactId>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-osgi-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-oval-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-pell-multipart-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-plexus-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-plugins</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-portlet-tiles-plugin</artifactId>
+1 -1
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-portlet-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-rest-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-sitegraph-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-sitemesh-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-spring-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-testng-plugin</artifactId>
+1 -1
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
</parent>
<artifactId>struts2-tiles-plugin</artifactId>
+2 -2
View File
@@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-parent</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
<packaging>pom</packaging>
<name>Struts 2</name>
<url>http://struts.apache.org/</url>
@@ -31,7 +31,7 @@
<connection>scm:git:git://git.apache.org/struts.git</connection>
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/struts.git</developerConnection>
<url>http://git.apache.org/struts.git</url>
<tag>STRUTS_2_5_3</tag>
<tag>STRUTS_2_5_4</tag>
</scm>
<issueManagement>