You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by jo...@apache.org on 2015/06/07 21:04:20 UTC
[1/6] struts git commit: WW-4510 Upgrade spring plugin dependencies
to spring version 4.x
Repository: struts
Updated Branches:
refs/heads/master 72e6f7073 -> b074c0888
WW-4510 Upgrade spring plugin dependencies to spring version 4.x
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/d7887000
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/d7887000
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/d7887000
Branch: refs/heads/master
Commit: d788700009a09a2ae9ca7107008cbe773dc2b3f5
Parents: 72e6f70
Author: Johannes Geppert <jo...@gmail.com>
Authored: Sun Jun 7 11:35:46 2015 +0200
Committer: Johannes Geppert <jo...@gmail.com>
Committed: Sun Jun 7 11:35:46 2015 +0200
----------------------------------------------------------------------
plugins/spring/pom.xml | 8 +++++
.../spring/StrutsSpringObjectFactory.java | 16 ++++------
.../spring/StrutsSpringObjectFactoryTest.java | 8 ++---
pom.xml | 2 +-
.../xwork2/spring/SpringObjectFactory.java | 28 +++++-------------
.../spring/SpringProxyableObjectFactory.java | 31 +++++++-------------
6 files changed, 35 insertions(+), 58 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/d7887000/plugins/spring/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/spring/pom.xml b/plugins/spring/pom.xml
index 0b06dbd..4e509f1 100644
--- a/plugins/spring/pom.xml
+++ b/plugins/spring/pom.xml
@@ -77,6 +77,14 @@
<scope>test</scope>
</dependency>
+ <!-- The Servlet API mocks in Spring Framework 4.0 support Servlet 3.0 and higher
+ So this is only necessary in tests-->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<properties>
http://git-wip-us.apache.org/repos/asf/struts/blob/d7887000/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java
----------------------------------------------------------------------
diff --git a/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java b/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java
index c34a6e4..f4a6f31 100644
--- a/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java
+++ b/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java
@@ -24,10 +24,10 @@ package org.apache.struts2.spring;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.spring.SpringObjectFactory;
-import org.apache.logging.log4j.Logger;
+import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.struts2.StrutsConstants;
-import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.WebApplicationContext;
@@ -74,9 +74,7 @@ public class StrutsSpringObjectFactory extends SpringObjectFactory {
super();
boolean useClassCache = "true".equals(useClassCacheStr);
- if (LOG.isInfoEnabled()) {
- LOG.info("Initializing Struts-Spring integration...");
- }
+ LOG.info("Initializing Struts-Spring integration...");
Object rootWebApplicationContext = servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
@@ -112,9 +110,7 @@ public class StrutsSpringObjectFactory extends SpringObjectFactory {
ClassReloadingXMLWebApplicationContext reloadingContext = (ClassReloadingXMLWebApplicationContext) appContext;
reloadingContext.setupReloading(watchList.split(","), acceptClasses, servletContext, "true".equals(reloadConfig));
- if (LOG.isInfoEnabled()) {
- LOG.info("Class reloading is enabled. Make sure this is not used on a production environment!", watchList);
- }
+ LOG.info("Class reloading is enabled. Make sure this is not used on a production environment!\n{}", watchList);
setClassLoader(reloadingContext.getReloadingClassLoader());
@@ -144,8 +140,6 @@ public class StrutsSpringObjectFactory extends SpringObjectFactory {
this.setEnableAopSupport(enableAopSupport);
- if (LOG.isInfoEnabled()) {
- LOG.info("... initialized Struts-Spring integration successfully");
- }
+ LOG.info("... initialized Struts-Spring integration successfully");
}
}
http://git-wip-us.apache.org/repos/asf/struts/blob/d7887000/plugins/spring/src/test/java/org/apache/struts2/spring/StrutsSpringObjectFactoryTest.java
----------------------------------------------------------------------
diff --git a/plugins/spring/src/test/java/org/apache/struts2/spring/StrutsSpringObjectFactoryTest.java b/plugins/spring/src/test/java/org/apache/struts2/spring/StrutsSpringObjectFactoryTest.java
index 92ce5a4..9141b02 100644
--- a/plugins/spring/src/test/java/org/apache/struts2/spring/StrutsSpringObjectFactoryTest.java
+++ b/plugins/spring/src/test/java/org/apache/struts2/spring/StrutsSpringObjectFactoryTest.java
@@ -21,10 +21,8 @@
package org.apache.struts2.spring;
-import javax.servlet.ServletContext;
-
+import com.opensymphony.xwork2.inject.Container;
import junit.framework.TestCase;
-import org.apache.struts2.StrutsConstants;
import org.easymock.EasyMock;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.mock.web.MockServletContext;
@@ -32,7 +30,7 @@ import org.springframework.web.context.ConfigurableWebApplicationContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.XmlWebApplicationContext;
-import com.opensymphony.xwork2.inject.Container;
+import javax.servlet.ServletContext;
/**
* Unit test for {@link StrutsSpringObjectFactory}.
@@ -55,7 +53,7 @@ public class StrutsSpringObjectFactoryTest extends TestCase {
EasyMock.replay(container);
ConfigurableWebApplicationContext ac = new XmlWebApplicationContext();
- ServletContext msc = (ServletContext) new MockServletContext();
+ ServletContext msc = new MockServletContext();
msc.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ac);
ac.setServletContext(msc);
ac.setConfigLocations(new String[] {"org/apache/struts2/spring/StrutsSpringObjectFactoryTest-applicationContext.xml"});
http://git-wip-us.apache.org/repos/asf/struts/blob/d7887000/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9fdec9d..bf48092 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,7 +85,7 @@
<properties>
<currentVersion>${project.version}</currentVersion>
- <struts2.springPlatformVersion>3.0.5.RELEASE</struts2.springPlatformVersion>
+ <struts2.springPlatformVersion>4.1.6.RELEASE</struts2.springPlatformVersion>
<ognl.version>3.0.6</ognl.version>
<asm.version>3.3</asm.version>
<asm5.version>5.0.2</asm5.version>
http://git-wip-us.apache.org/repos/asf/struts/blob/d7887000/xwork-core/src/main/java/com/opensymphony/xwork2/spring/SpringObjectFactory.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/spring/SpringObjectFactory.java b/xwork-core/src/main/java/com/opensymphony/xwork2/spring/SpringObjectFactory.java
index 2cfb091..718480f 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/spring/SpringObjectFactory.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/spring/SpringObjectFactory.java
@@ -17,8 +17,8 @@ package com.opensymphony.xwork2.spring;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.inject.Inject;
-import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.UnsatisfiedDependencyException;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
@@ -70,8 +70,7 @@ public class SpringObjectFactory extends ObjectFactory implements ApplicationCon
*
* @param appContext The Spring ApplicationContext that should be used to look beans up with.
*/
- public void setApplicationContext(ApplicationContext appContext)
- throws BeansException {
+ public void setApplicationContext(ApplicationContext appContext) throws BeansException {
this.appContext = appContext;
autoWiringFactory = findAutoWiringBeanFactory(this.appContext);
}
@@ -84,33 +83,23 @@ public class SpringObjectFactory extends ObjectFactory implements ApplicationCon
public void setAutowireStrategy(int autowireStrategy) {
switch (autowireStrategy) {
case AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT:
- if (LOG.isInfoEnabled()) {
- LOG.info("Setting autowire strategy to autodetect");
- }
+ LOG.info("Setting autowire strategy to autodetect");
this.autowireStrategy = autowireStrategy;
break;
case AutowireCapableBeanFactory.AUTOWIRE_BY_NAME:
- if (LOG.isInfoEnabled()) {
- LOG.info("Setting autowire strategy to name");
- }
+ LOG.info("Setting autowire strategy to name");
this.autowireStrategy = autowireStrategy;
break;
case AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE:
- if (LOG.isInfoEnabled()) {
- LOG.info("Setting autowire strategy to type");
- }
+ LOG.info("Setting autowire strategy to type");
this.autowireStrategy = autowireStrategy;
break;
case AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR:
- if (LOG.isInfoEnabled()) {
- LOG.info("Setting autowire strategy to constructor");
- }
+ LOG.info("Setting autowire strategy to constructor");
this.autowireStrategy = autowireStrategy;
break;
case AutowireCapableBeanFactory.AUTOWIRE_NO:
- if (LOG.isInfoEnabled()) {
- LOG.info("Setting autowire strategy to none");
- }
+ LOG.info("Setting autowire strategy to none");
this.autowireStrategy = autowireStrategy;
break;
default:
@@ -198,8 +187,7 @@ public class SpringObjectFactory extends ObjectFactory implements ApplicationCon
return autoWireBean(bean, autoWiringFactory);
}
} catch (UnsatisfiedDependencyException e) {
- if (LOG.isErrorEnabled())
- LOG.error("Error building bean", e);
+ LOG.error("Error building bean", e);
// Fall back
return autoWireBean(super.buildBean(clazz, extraContext), autoWiringFactory);
}
http://git-wip-us.apache.org/repos/asf/struts/blob/d7887000/xwork-core/src/main/java/com/opensymphony/xwork2/spring/SpringProxyableObjectFactory.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/spring/SpringProxyableObjectFactory.java b/xwork-core/src/main/java/com/opensymphony/xwork2/spring/SpringProxyableObjectFactory.java
index 616ac0f..3f701a1 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/spring/SpringProxyableObjectFactory.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/spring/SpringProxyableObjectFactory.java
@@ -15,9 +15,10 @@
*/
package com.opensymphony.xwork2.spring;
-import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.ApplicationContext;
@@ -39,36 +40,26 @@ public class SpringProxyableObjectFactory extends SpringObjectFactory {
@Override
public Object buildBean(String beanName, Map<String, Object> extraContext) throws Exception {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Building bean for name " + beanName);
- }
+ LOG.debug("Building bean for name {}", beanName);
if (!skipBeanNames.contains(beanName)) {
ApplicationContext anAppContext = getApplicationContext(extraContext);
try {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Trying the application context... appContext = " + anAppContext + ",\n bean name = " + beanName);
- }
+ LOG.debug("Trying the application context... appContext = {},\n bean name = {}", anAppContext, beanName);
return anAppContext.getBean(beanName);
} catch (NoSuchBeanDefinitionException e) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Did not find bean definition for bean named " + beanName + ", creating a new one...");
- }
+ LOG.debug("Did not find bean definition for bean named {}, creating a new one...", beanName);
if (autoWiringFactory instanceof BeanDefinitionRegistry) {
try {
Class clazz = Class.forName(beanName);
BeanDefinitionRegistry registry = (BeanDefinitionRegistry) autoWiringFactory;
- RootBeanDefinition def = new RootBeanDefinition(clazz, autowireStrategy);
- def.setSingleton(false);
- if (LOG.isDebugEnabled()) {
- LOG.debug("Registering a new bean definition for class " + beanName);
- }
+ RootBeanDefinition def = new RootBeanDefinition(clazz, autowireStrategy, true);
+ def.setScope(BeanDefinition.SCOPE_SINGLETON);
+ LOG.debug("Registering a new bean definition for class {}", beanName);
registry.registerBeanDefinition(beanName,def);
try {
return anAppContext.getBean(beanName);
} catch (NoSuchBeanDefinitionException e2) {
- if (LOG.isWarnEnabled()) {
- LOG.warn("Could not register new bean definition for bean " + beanName);
- }
+ LOG.warn("Could not register new bean definition for bean {}", beanName);
skipBeanNames.add(beanName);
}
} catch (ClassNotFoundException e1) {
@@ -77,9 +68,7 @@ public class SpringProxyableObjectFactory extends SpringObjectFactory {
}
}
}
- if (LOG.isDebugEnabled()) {
- LOG.debug("Returning autowired instance created by default ObjectFactory");
- }
+ LOG.debug("Returning autowired instance created by default ObjectFactory");
return autoWireBean(super.buildBean(beanName, extraContext), autoWiringFactory);
}
[6/6] struts git commit: Correct some urls to the docs to the right
location
Posted by jo...@apache.org.
Correct some urls to the docs to the right location
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/b074c088
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/b074c088
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/b074c088
Branch: refs/heads/master
Commit: b074c088842a9c6fed6c0f6442d7f9030b469c5e
Parents: 243c92b
Author: Johannes Geppert <jo...@gmail.com>
Authored: Sun Jun 7 21:03:54 2015 +0200
Committer: Johannes Geppert <jo...@gmail.com>
Committed: Sun Jun 7 21:03:54 2015 +0200
----------------------------------------------------------------------
.../src/main/resources/archetype-resources/README.txt | 2 +-
.../struts2/dispatcher/ActionContextCleanUp.java | 13 ++++---------
.../apache/struts2/dispatcher/FilterDispatcher.java | 14 ++++----------
.../dispatcher/mapper/CompositeActionMapper.java | 4 ++--
.../dispatcher/mapper/Restful2ActionMapper.java | 4 ++--
.../dispatcher/mapper/RestfulActionMapper.java | 4 ++--
.../src/main/resources/config-browser/page-footer.ftl | 7 +++++--
7 files changed, 20 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/b074c088/archetypes/struts2-archetype-plugin/src/main/resources/archetype-resources/README.txt
----------------------------------------------------------------------
diff --git a/archetypes/struts2-archetype-plugin/src/main/resources/archetype-resources/README.txt b/archetypes/struts2-archetype-plugin/src/main/resources/archetype-resources/README.txt
index dfc213d..72cac9a 100644
--- a/archetypes/struts2-archetype-plugin/src/main/resources/archetype-resources/README.txt
+++ b/archetypes/struts2-archetype-plugin/src/main/resources/archetype-resources/README.txt
@@ -5,6 +5,6 @@ plugin.
For more on Struts plugins, see
-* http://struts.apache.org/2.x/docs/plugins.html
+* http://struts.apache.org/docs/plugins.html
----------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/b074c088/core/src/main/java/org/apache/struts2/dispatcher/ActionContextCleanUp.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/dispatcher/ActionContextCleanUp.java b/core/src/main/java/org/apache/struts2/dispatcher/ActionContextCleanUp.java
index 8664b64..528e611 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/ActionContextCleanUp.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/ActionContextCleanUp.java
@@ -22,16 +22,11 @@
package org.apache.struts2.dispatcher;
import com.opensymphony.xwork2.ActionContext;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.LogManager;
import com.opensymphony.xwork2.util.profiling.UtilTimerStack;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
-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;
@@ -150,7 +145,7 @@ public class ActionContextCleanUp implements Filter {
"* This can be a source of unpredictable problems! *\n" +
"* *\n" +
"* Please refer to the docs for more details! *\n" +
- "* http://struts.apache.org/2.x/docs/webxml.html *\n" +
+ "* http://struts.apache.org/docs/webxml.html *\n" +
"* *\n" +
"***************************************************************************\n\n";
System.out.println(msg);
http://git-wip-us.apache.org/repos/asf/struts/blob/b074c088/core/src/main/java/org/apache/struts2/dispatcher/FilterDispatcher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/dispatcher/FilterDispatcher.java b/core/src/main/java/org/apache/struts2/dispatcher/FilterDispatcher.java
index 715ad94..6fbbd0b 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/FilterDispatcher.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/FilterDispatcher.java
@@ -29,22 +29,16 @@ import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.ValueStackFactory;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.LogManager;
import com.opensymphony.xwork2.util.profiling.UtilTimerStack;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.struts2.RequestUtils;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.dispatcher.ng.filter.FilterHostConfig;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletContext;
-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;
@@ -457,7 +451,7 @@ public class FilterDispatcher implements StrutsStatics, Filter {
"* This can be a source of unpredictable problems! *\n" +
"* *\n" +
"* Please refer to the docs for more details! *\n" +
- "* http://struts.apache.org/2.x/docs/webxml.html *\n" +
+ "* http://struts.apache.org/docs/webxml.html *\n" +
"* *\n" +
"***********************************************************************\n\n";
System.out.println(msg);
http://git-wip-us.apache.org/repos/asf/struts/blob/b074c088/core/src/main/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapper.java b/core/src/main/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapper.java
index 17a4611..a648590 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapper.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapper.java
@@ -24,8 +24,8 @@ package org.apache.struts2.dispatcher.mapper;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
-import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.struts2.StrutsConstants;
import javax.servlet.http.HttpServletRequest;
@@ -38,7 +38,7 @@ import java.util.List;
* 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.
*
- * More details: http://struts.apache.org/2.x/docs/actionmapper.html
+ * More details: http://struts.apache.org/docs/actionmapper.html
*
* @see ActionMapper
* @see ActionMapping
http://git-wip-us.apache.org/repos/asf/struts/blob/b074c088/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java b/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java
index d00d797..996d257 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java
@@ -23,8 +23,8 @@ package org.apache.struts2.dispatcher.mapper;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.inject.Inject;
-import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.struts2.StrutsConstants;
import javax.servlet.http.HttpServletRequest;
@@ -34,7 +34,7 @@ import java.util.StringTokenizer;
/**
* Extended version of {@link RestfulActionMapper}, see documentation for more details
- * http://struts.apache.org/2.x/docs/restfulactionmapper.html
+ * http://struts.apache.org/docs/restfulactionmapper.html
*/
public class Restful2ActionMapper extends DefaultActionMapper {
http://git-wip-us.apache.org/repos/asf/struts/blob/b074c088/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java b/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java
index 7af01c3..13ede87 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java
@@ -22,8 +22,8 @@
package org.apache.struts2.dispatcher.mapper;
import com.opensymphony.xwork2.config.ConfigurationManager;
-import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.struts2.RequestUtils;
import javax.servlet.http.HttpServletRequest;
@@ -35,7 +35,7 @@ import java.util.StringTokenizer;
/**
* Simple Restfull Action Mapper to support REST application
* See docs for more information
- * http://struts.apache.org/2.x/docs/restfulactionmapper.html
+ * http://struts.apache.org/docs/restfulactionmapper.html
*/
public class RestfulActionMapper implements ActionMapper {
protected static final Logger LOG = LogManager.getLogger(RestfulActionMapper.class);
http://git-wip-us.apache.org/repos/asf/struts/blob/b074c088/plugins/config-browser/src/main/resources/config-browser/page-footer.ftl
----------------------------------------------------------------------
diff --git a/plugins/config-browser/src/main/resources/config-browser/page-footer.ftl b/plugins/config-browser/src/main/resources/config-browser/page-footer.ftl
index 56ed87b..b69f775 100644
--- a/plugins/config-browser/src/main/resources/config-browser/page-footer.ftl
+++ b/plugins/config-browser/src/main/resources/config-browser/page-footer.ftl
@@ -28,8 +28,11 @@
<div id="breadcrumbs">
<table border="0" cellspacing="0" cellpadding="4" width="100%">
<tr>
- <td align="center">
- <a href="http://struts.apache.org/">Apache Struts Project</a> <a href="http://struts.apache.org/2.0">Struts</a> © 2003 - 2006 | <a href="http://issues.apache.org/struts/">Bugs</a> | <a href="http://struts.apache.org/mail.html">Mailing Lists</a>
+ <td align="center">
+ <a href="http://struts.apache.org/">Apache Struts Project</a> <a
+ href="http://struts.apache.org">Struts</a> © 2003 - 2015 | <a
+ href="https://issues.apache.org/jira/browse/WW/">Bugs</a> | <a
+ href="http://struts.apache.org/mail.html">Mailing Lists</a>
</td>
</tr>
</table>
[3/6] struts git commit: Merge branch 'master' into spring4
Posted by jo...@apache.org.
Merge branch 'master' into spring4
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/c951b15c
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/c951b15c
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/c951b15c
Branch: refs/heads/master
Commit: c951b15c1cb1f7e8e95690203dab0e91306c7f65
Parents: d788700 9c67e4e
Author: Johannes Geppert <jo...@gmail.com>
Authored: Sun Jun 7 11:55:02 2015 +0200
Committer: Johannes Geppert <jo...@gmail.com>
Committed: Sun Jun 7 11:55:02 2015 +0200
----------------------------------------------------------------------
.../struts2/dispatcher/StreamResultTest.java | 25 +++++++++---------
.../interceptor/FileUploadInterceptorTest.java | 8 +++---
core/src/test/resources/log4j.properties | 27 --------------------
core/src/test/resources/log4j2.xml | 13 ++++++++++
pom.xml | 1 +
xwork-core/pom.xml | 1 +
6 files changed, 31 insertions(+), 44 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/c951b15c/pom.xml
----------------------------------------------------------------------
[2/6] struts git commit: Solve problem when xwork and core tests are
running on a machine where default local is different from "en"
Posted by jo...@apache.org.
Solve problem when xwork and core tests are running on a machine where default local is different from "en"
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/9c67e4e8
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/9c67e4e8
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/9c67e4e8
Branch: refs/heads/master
Commit: 9c67e4e8366b5c30a02d4b2ee496493e8abda837
Parents: 72e6f70
Author: Johannes Geppert <jo...@gmail.com>
Authored: Sun Jun 7 11:54:46 2015 +0200
Committer: Johannes Geppert <jo...@gmail.com>
Committed: Sun Jun 7 11:54:46 2015 +0200
----------------------------------------------------------------------
.../struts2/dispatcher/StreamResultTest.java | 25 +++++++++---------
.../interceptor/FileUploadInterceptorTest.java | 8 +++---
core/src/test/resources/log4j.properties | 27 --------------------
core/src/test/resources/log4j2.xml | 13 ++++++++++
pom.xml | 1 +
xwork-core/pom.xml | 1 +
6 files changed, 31 insertions(+), 44 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/9c67e4e8/core/src/test/java/org/apache/struts2/dispatcher/StreamResultTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/dispatcher/StreamResultTest.java b/core/src/test/java/org/apache/struts2/dispatcher/StreamResultTest.java
index 054dbe3..147823d 100644
--- a/core/src/test/java/org/apache/struts2/dispatcher/StreamResultTest.java
+++ b/core/src/test/java/org/apache/struts2/dispatcher/StreamResultTest.java
@@ -21,22 +21,21 @@
package org.apache.struts2.dispatcher;
+import com.opensymphony.xwork2.Action;
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.mock.MockActionInvocation;
+import com.opensymphony.xwork2.util.ClassLoaderUtil;
+import com.opensymphony.xwork2.util.ValueStack;
+import org.apache.struts2.ServletActionContext;
+import org.apache.struts2.StrutsInternalTestCase;
+import org.springframework.mock.web.MockHttpServletResponse;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.net.URI;
import java.net.URL;
-import org.apache.struts2.ServletActionContext;
-import org.apache.struts2.StrutsInternalTestCase;
-import org.springframework.mock.web.MockHttpServletResponse;
-
-import com.opensymphony.xwork2.util.ClassLoaderUtil;
-import com.opensymphony.xwork2.Action;
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.mock.MockActionInvocation;
-import com.opensymphony.xwork2.util.ValueStack;
-
/**
* Unit test for {@link StreamResult}.
*
@@ -249,8 +248,8 @@ public class StreamResultTest extends StrutsInternalTestCase {
public class MyImageAction implements Action {
public InputStream getStreamForImage() throws Exception {
- // just use src/test/log4j.properties as test file
- URL url = ClassLoaderUtil.getResource("log4j.properties", StreamResultTest.class);
+ // just use src/test/log4j2.xml as test file
+ URL url = ClassLoaderUtil.getResource("log4j2.xml", StreamResultTest.class);
File file = new File(new URI(url.toString()));
FileInputStream fis = new FileInputStream(file);
return fis;
@@ -261,7 +260,7 @@ public class StreamResultTest extends StrutsInternalTestCase {
}
public long getContentLength() throws Exception {
- URL url = ClassLoaderUtil.getResource("log4j.properties", StreamResultTest.class);
+ URL url = ClassLoaderUtil.getResource("log4j2.xml", StreamResultTest.class);
File file = new File(new URI(url.toString()));
return file.length();
}
http://git-wip-us.apache.org/repos/asf/struts/blob/9c67e4e8/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java b/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java
index acf045e..9dbb114 100644
--- a/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java
+++ b/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java
@@ -158,9 +158,9 @@ public class FileUploadInterceptorTest extends StrutsInternalTestCase {
// when file is not of allowed types
ValidationAwareSupport validation = new ValidationAwareSupport();
- URL url = ClassLoaderUtil.getResource("log4j.properties", FileUploadInterceptorTest.class);
+ URL url = ClassLoaderUtil.getResource("log4j2.xml", FileUploadInterceptorTest.class);
File file = new File(new URI(url.toString()));
- assertTrue("log4j.properties should be in src/test folder", file.exists());
+ assertTrue("log4j2.xml should be in src/test folder", file.exists());
boolean notOk = interceptor.acceptFile(action, file, "filename", "text/html", "inputName", validation);
assertFalse(notOk);
@@ -169,10 +169,10 @@ public class FileUploadInterceptorTest extends StrutsInternalTestCase {
List errors = (List) validation.getFieldErrors().get("inputName");
assertEquals(1, errors.size());
String msg = (String) errors.get(0);
- // the error message shoul contain at least this test
+ // the error message should contain at least this test
assertTrue(msg.startsWith("The file is to large to be uploaded"));
assertTrue(msg.indexOf("inputName") > 0);
- assertTrue(msg.indexOf("log4j.properties") > 0);
+ assertTrue(msg.indexOf("log4j2.xml") > 0);
}
public void testNoMultipartRequest() throws Exception {
http://git-wip-us.apache.org/repos/asf/struts/blob/9c67e4e8/core/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/core/src/test/resources/log4j.properties b/core/src/test/resources/log4j.properties
deleted file mode 100644
index 28ca560..0000000
--- a/core/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,27 +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.
-#
-log4j.rootLogger = WARN, stdout
-
-log4j.appender.stdout = org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Threshold = WARN
-log4j.appender.stdout.Target = System.out
-log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern = %d{ISO8601} %-5p [%F:%L] : %m%n
http://git-wip-us.apache.org/repos/asf/struts/blob/9c67e4e8/core/src/test/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/core/src/test/resources/log4j2.xml b/core/src/test/resources/log4j2.xml
new file mode 100644
index 0000000..4b13539
--- /dev/null
+++ b/core/src/test/resources/log4j2.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration>
+ <Appenders>
+ <Console name="STDOUT" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d{ISO8601} %-5p [%F:%L] : %m%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Root level="warn">
+ <AppenderRef ref="STDOUT"/>
+ </Root>
+ </Loggers>
+</Configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts/blob/9c67e4e8/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9fdec9d..f0c4be6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -156,6 +156,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.3.1</version>
<configuration>
+ <argLine>-Duser.language=en -Duser.region=US</argLine>
<includes>
<include>**/*Test.java</include>
</includes>
http://git-wip-us.apache.org/repos/asf/struts/blob/9c67e4e8/xwork-core/pom.xml
----------------------------------------------------------------------
diff --git a/xwork-core/pom.xml b/xwork-core/pom.xml
index fca1912..3ba6461 100644
--- a/xwork-core/pom.xml
+++ b/xwork-core/pom.xml
@@ -37,6 +37,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<configuration>
+ <argLine>-Duser.language=en -Duser.region=US</argLine>
<properties>
<property>
<name>maven.testng.output.dir</name>
[5/6] struts git commit: WW-4510 Upgrade spring plugin dependencies
to spring version 4.x
Posted by jo...@apache.org.
WW-4510 Upgrade spring plugin dependencies to spring version 4.x
- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/243c92bf
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/243c92bf
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/243c92bf
Branch: refs/heads/master
Commit: 243c92bf4605dc694aaea3e1cff25367c8f6970f
Parents: 8aa389e
Author: Johannes Geppert <jo...@gmail.com>
Authored: Sun Jun 7 20:59:42 2015 +0200
Committer: Johannes Geppert <jo...@gmail.com>
Committed: Sun Jun 7 20:59:42 2015 +0200
----------------------------------------------------------------------
apps/blank/pom.xml | 3 +-
apps/jboss-blank/pom.xml | 4 +-
apps/portlet/pom.xml | 6 +-
.../pluto-portal-driver-services-config.xml | 155 +++++++++++++++++++
.../main/webapp/WEB-INF/applicationContext.xml | 10 +-
.../src/test/java/JettyPlutoLauncher.java | 8 +-
.../struts2/portlet/test/BasePortletTest.java | 8 +-
apps/showcase/pom.xml | 9 ++
core/pom.xml | 5 -
plugins/embeddedjsp/pom.xml | 9 ++
plugins/jfreechart/pom.xml | 9 ++
plugins/json/pom.xml | 9 ++
plugins/junit/pom.xml | 9 ++
plugins/portlet/pom.xml | 9 ++
plugins/rest/pom.xml | 9 ++
.../struts2/rest/DefaultHttpHeadersTest.java | 11 +-
plugins/sitegraph/pom.xml | 9 ++
plugins/testng/pom.xml | 9 ++
pom.xml | 2 +-
19 files changed, 263 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/apps/blank/pom.xml
----------------------------------------------------------------------
diff --git a/apps/blank/pom.xml b/apps/blank/pom.xml
index cec84f6..5d170e9 100644
--- a/apps/blank/pom.xml
+++ b/apps/blank/pom.xml
@@ -37,7 +37,8 @@
<dependency>
<groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
<scope>provided</scope>
</dependency>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/apps/jboss-blank/pom.xml
----------------------------------------------------------------------
diff --git a/apps/jboss-blank/pom.xml b/apps/jboss-blank/pom.xml
index 07f0166..ad9ebdb 100644
--- a/apps/jboss-blank/pom.xml
+++ b/apps/jboss-blank/pom.xml
@@ -37,8 +37,8 @@
<dependency>
<groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
<scope>provided</scope>
</dependency>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/apps/portlet/pom.xml
----------------------------------------------------------------------
diff --git a/apps/portlet/pom.xml b/apps/portlet/pom.xml
index a5a7adc..12ddb68 100644
--- a/apps/portlet/pom.xml
+++ b/apps/portlet/pom.xml
@@ -49,7 +49,7 @@
<plugin>
<groupId>org.apache.pluto</groupId>
<artifactId>maven-pluto-plugin</artifactId>
- <version>1.1.3</version>
+ <version>1.1.7</version>
<executions>
<execution>
<phase>generate-resources</phase>
@@ -68,7 +68,7 @@
<webDefaultXml>src/main/webapp/WEB-INF/jetty-pluto-web-default.xml</webDefaultXml>
<systemProperties>
<systemProperty>
- <name>org.apache.pluto.embedded.portletId</name>
+ <name>org.apache.pluto.embedded.portletIds</name>
<value>StrutsPortlet</value>
</systemProperty>
</systemProperties>
@@ -172,7 +172,7 @@
<dependency>
<groupId>com.bekk.boss</groupId>
<artifactId>maven-jetty-pluto-embedded</artifactId>
- <version>1.0</version>
+ <version>1.0.1</version>
<scope>test</scope>
</dependency>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/apps/portlet/src/main/resources/pluto-portal-driver-services-config.xml
----------------------------------------------------------------------
diff --git a/apps/portlet/src/main/resources/pluto-portal-driver-services-config.xml b/apps/portlet/src/main/resources/pluto-portal-driver-services-config.xml
new file mode 100644
index 0000000..6803d03
--- /dev/null
+++ b/apps/portlet/src/main/resources/pluto-portal-driver-services-config.xml
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+ <!--
+ 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.
+ -->
+ <!--
+
+ ************************************************************
+
+ NOTE:
+
+ The following configuration file contains the spring bean
+ configuration needed to run the pluto-portal in memory
+ mode. Optional services are available which allow
+ persistence to an rdbms, xml files, etc. . . however,
+ we strongly recomend that if you are looking at these
+ advanced features that you consider an enterprise portal
+ such as Apache Jetspeed.
+
+ Service Functions Include:
+ - Preference Persistence
+ - User Attribute Persistence
+ - Portlet Registry
+ - Page Registry
+ ************************************************************
+
+ -->
+
+ <bean id="RequiredContainerServices"
+ name="OptionalContainerServices"
+ class="org.apache.pluto.driver.services.container.ContainerServicesImpl"
+ scope="singleton">
+ <constructor-arg>
+ <ref bean="PortalContext"/>
+ </constructor-arg>
+ <constructor-arg>
+ <ref bean="DriverConfiguration"/>
+ </constructor-arg>
+ </bean>
+
+ <bean id="PortalContext"
+ class="org.apache.pluto.driver.services.container.PortalContextImpl">
+ <constructor-arg>
+ <ref bean="DriverConfiguration"/>
+ </constructor-arg>
+ </bean>
+
+
+ <!-- ================================================ -->
+ <!-- The single top element of the configuration tree -->
+ <!-- ================================================ -->
+ <bean id="DriverConfiguration"
+ class="org.apache.pluto.driver.config.impl.DriverConfigurationImpl">
+
+ <!-- ===== Portal Services ===== -->
+ <constructor-arg>
+ <ref bean="PortalURLParser"/>
+ </constructor-arg>
+ <constructor-arg>
+ <ref bean="PropertyConfigService"/>
+ </constructor-arg>
+ <constructor-arg>
+ <ref bean="RenderConfigService"/>
+ </constructor-arg>
+ <constructor-arg>
+ <ref bean="SupportedModesService"/>
+ </constructor-arg>
+ <constructor-arg>
+ <ref bean="SupportedWindowStatesService"/>
+ </constructor-arg>
+
+ <!-- === Container Services === -->
+ <constructor-arg>
+ <ref bean="PortalCallbackService"/>
+ </constructor-arg>
+
+ <!-- Optional Container Services -->
+ <!--
+ <property name="portletPreferencesService"><ref bean="PortletPreferencesService"/></property>
+ <property name="userAttributeService"><ref bean="UserAttributeService"/></property>
+ -->
+ </bean>
+
+ <!-- ================================================ -->
+ <!-- The single top element of the administration tree -->
+ <!-- ================================================ -->
+ <bean id="AdminConfiguration" class="org.apache.pluto.driver.config.impl.AdminConfigurationImpl">
+ <property name="renderConfigAdminService">
+ <ref bean="RenderConfigService"/>
+ </property>
+ </bean>
+
+
+ <!-- ================================================ -->
+ <!-- Portal Services injected into the Configuration -->
+ <!-- ================================================ -->
+ <bean id="PortalURLParser"
+ class="org.apache.pluto.driver.url.impl.PortalURLParserImpl"
+ factory-method="getParser"
+ scope="singleton">
+ </bean>
+
+ <bean id="PropertyConfigService"
+ class="org.apache.pluto.driver.services.impl.resource.PropertyConfigServiceImpl"
+ scope="singleton">
+ </bean>
+
+ <bean id="RenderConfigService"
+ class="org.apache.pluto.driver.services.impl.resource.RenderConfigServiceImpl"
+ scope="singleton">
+ </bean>
+
+ <bean id="SupportedModesService"
+ class="org.apache.pluto.driver.services.impl.resource.SupportedModesServiceImpl"
+ scope="singleton">
+ <constructor-arg>
+ <ref bean="PropertyConfigService"/>
+ </constructor-arg>
+ </bean>
+
+ <bean id="SupportedWindowStatesService"
+ class="org.apache.pluto.driver.services.impl.resource.SupportedWindowStateServiceImpl"
+ scope="singleton">
+ <constructor-arg>
+ <ref bean="PropertyConfigService"/>
+ </constructor-arg>
+ </bean>
+
+ <!-- ================================================ -->
+ <!-- Container Services injected into Configuration -->
+ <!-- ================================================ -->
+ <bean id="PortalCallbackService"
+ class="org.apache.pluto.driver.services.container.PortalCallbackServiceImpl"
+ scope="singleton">
+ </bean>
+
+</beans>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/apps/portlet/src/main/webapp/WEB-INF/applicationContext.xml
----------------------------------------------------------------------
diff --git a/apps/portlet/src/main/webapp/WEB-INF/applicationContext.xml b/apps/portlet/src/main/webapp/WEB-INF/applicationContext.xml
index 6bd3e54..5df7f35 100644
--- a/apps/portlet/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/apps/portlet/src/main/webapp/WEB-INF/applicationContext.xml
@@ -1,16 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
<!--
- Application context definition for "springapp" DispatcherServlet.
-->
-<beans default-autowire="autodetect">
<bean id="thingManager"
class="org.apache.struts2.portlet.example.spring.ThingManager">
</bean>
+
<bean id="springAction"
- class="org.apache.struts2.portlet.example.spring.SpringAction" singleton="false">
+ class="org.apache.struts2.portlet.example.spring.SpringAction" scope="prototype">
<property name="thingManager">
<ref bean="thingManager" />
</property>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/apps/portlet/src/test/java/JettyPlutoLauncher.java
----------------------------------------------------------------------
diff --git a/apps/portlet/src/test/java/JettyPlutoLauncher.java b/apps/portlet/src/test/java/JettyPlutoLauncher.java
index ba5e352..ef24a40 100644
--- a/apps/portlet/src/test/java/JettyPlutoLauncher.java
+++ b/apps/portlet/src/test/java/JettyPlutoLauncher.java
@@ -5,10 +5,10 @@ import org.mortbay.jetty.webapp.WebAppContext;
public class JettyPlutoLauncher {
public static void main(String[] args) throws Exception {
- System.setProperty("org.apache.pluto.embedded.portletId", "StrutsPortlet");
- Server server = new Server(8080);
- WebAppContext webapp = new WebAppContext("src/main/webapp", "/test");
- webapp.setDefaultsDescriptor("/WEB-INF/jetty-pluto-web-default.xml");
+ System.setProperty("org.apache.pluto.embedded.portletIds", "StrutsPortlet");
+ Server server = new Server(8080);
+ WebAppContext webapp = new WebAppContext(System.getProperty("user.dir") + "/apps/portlet/src/main/webapp", "/test");
+ webapp.setDefaultsDescriptor("/WEB-INF/jetty-pluto-web-default.xml");
ServletHolder portletServlet = new ServletHolder(new PortletServlet());
portletServlet.setInitParameter("portlet-name", "StrutsPortlet");
portletServlet.setInitOrder(1);
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
----------------------------------------------------------------------
diff --git a/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java b/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
index eceb4c9..13f172f 100644
--- a/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
+++ b/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
@@ -1,14 +1,13 @@
package org.apache.struts2.portlet.test;
-import java.io.File;
-
import net.sourceforge.jwebunit.junit.WebTestCase;
-
import org.apache.pluto.core.PortletServlet;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.ServletHolder;
import org.mortbay.jetty.webapp.WebAppContext;
+import java.io.File;
+
public abstract class BasePortletTest extends WebTestCase {
protected Server server;
@@ -18,8 +17,9 @@ public abstract class BasePortletTest extends WebTestCase {
private int port;
public void setUp() throws Exception {
- System.setProperty("org.apache.pluto.embedded.portletId", getPortletName());
+ System.setProperty("org.apache.pluto.embedded.portletIds", getPortletName());
server = new Server(port);
+
WebAppContext webapp = new WebAppContext("src/main/webapp", contextPath);
webapp.setTempDirectory(new File("target/work"));
webapp.setDefaultsDescriptor("/WEB-INF/jetty-pluto-web-default.xml");
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/apps/showcase/pom.xml
----------------------------------------------------------------------
diff --git a/apps/showcase/pom.xml b/apps/showcase/pom.xml
index e1c9b77..7173275 100644
--- a/apps/showcase/pom.xml
+++ b/apps/showcase/pom.xml
@@ -177,6 +177,15 @@
<version>3.0.0</version>
</dependency>
+ <!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
+ This is only necessary in tests-->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 34a1c55..be09a0b 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -311,11 +311,6 @@
<version>3.1.0</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/plugins/embeddedjsp/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/embeddedjsp/pom.xml b/plugins/embeddedjsp/pom.xml
index 89ace69..077b861 100644
--- a/plugins/embeddedjsp/pom.xml
+++ b/plugins/embeddedjsp/pom.xml
@@ -82,6 +82,15 @@
<artifactId>jasper</artifactId>
<scope>provided</scope>
</dependency>
+
+ <!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
+ This is only necessary in tests-->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/plugins/jfreechart/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/jfreechart/pom.xml b/plugins/jfreechart/pom.xml
index dda577d..a6a19d8 100644
--- a/plugins/jfreechart/pom.xml
+++ b/plugins/jfreechart/pom.xml
@@ -74,6 +74,15 @@
<scope>test</scope>
</dependency>
+ <!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
+ This is only necessary in tests-->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/plugins/json/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/json/pom.xml b/plugins/json/pom.xml
index f060a26..fc3d83d 100644
--- a/plugins/json/pom.xml
+++ b/plugins/json/pom.xml
@@ -97,6 +97,15 @@
<scope>test</scope>
</dependency>
+ <!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
+ This is only necessary in tests-->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/plugins/junit/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/junit/pom.xml b/plugins/junit/pom.xml
index 32caa77..798c143 100644
--- a/plugins/junit/pom.xml
+++ b/plugins/junit/pom.xml
@@ -74,6 +74,15 @@
<artifactId>portlet-api</artifactId>
<scope>test</scope>
</dependency>
+
+ <!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
+ This is only necessary in tests-->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/plugins/portlet/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/portlet/pom.xml b/plugins/portlet/pom.xml
index fb88984..da5a8ca 100644
--- a/plugins/portlet/pom.xml
+++ b/plugins/portlet/pom.xml
@@ -115,6 +115,15 @@
<artifactId>cglib</artifactId>
<scope>test</scope>
</dependency>
+
+ <!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
+ This is only necessary in tests-->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/plugins/rest/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/rest/pom.xml b/plugins/rest/pom.xml
index a151084..2ad36e7 100644
--- a/plugins/rest/pom.xml
+++ b/plugins/rest/pom.xml
@@ -77,6 +77,15 @@
<optional>true</optional>
</dependency>
+ <!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
+ This is only necessary in tests-->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultHttpHeadersTest.java
----------------------------------------------------------------------
diff --git a/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultHttpHeadersTest.java b/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultHttpHeadersTest.java
index f46a203..57e9d67 100644
--- a/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultHttpHeadersTest.java
+++ b/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultHttpHeadersTest.java
@@ -28,10 +28,7 @@ import org.springframework.mock.web.MockHttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
-import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
-import static javax.servlet.http.HttpServletResponse.SC_CREATED;
-import static javax.servlet.http.HttpServletResponse.SC_NOT_MODIFIED;
-import static javax.servlet.http.HttpServletResponse.SC_OK;
+import static javax.servlet.http.HttpServletResponse.*;
public class DefaultHttpHeadersTest extends TestCase {
private MockHttpServletResponse mockResponse;
@@ -61,9 +58,9 @@ public class DefaultHttpHeadersTest extends TestCase {
headers.apply(mockRequest, mockResponse, new Object());
assertEquals(SC_CREATED, mockResponse.getStatus());
- assertEquals("http://localhost:80/foo/bar/44.xhtml", mockResponse.getHeader("Location"));
+ assertEquals("http://localhost/foo/bar/44.xhtml", mockResponse.getHeader("Location"));
assertEquals("asdf", mockResponse.getHeader("ETag"));
- assertEquals(now.getTime(), mockResponse.getHeader("Last-Modified"));
+ assertEquals(String.valueOf(now.getTime()), mockResponse.getHeader("Last-Modified"));
}
@@ -73,7 +70,7 @@ public class DefaultHttpHeadersTest extends TestCase {
mockRequest.setRequestURI("/foo/bar");
headers.apply(mockRequest, mockResponse, new Object());
- assertEquals("http://localhost:80/foo/bar/44", mockResponse.getHeader("Location"));
+ assertEquals("http://localhost/foo/bar/44", mockResponse.getHeader("Location"));
assertEquals(SC_CREATED, mockResponse.getStatus());
}
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/plugins/sitegraph/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/sitegraph/pom.xml b/plugins/sitegraph/pom.xml
index 289f7c8..8f6302f 100644
--- a/plugins/sitegraph/pom.xml
+++ b/plugins/sitegraph/pom.xml
@@ -137,6 +137,15 @@
<scope>test</scope>
</dependency>
+ <!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
+ This is only necessary in tests-->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<reporting>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/plugins/testng/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/testng/pom.xml b/plugins/testng/pom.xml
index 8b76997..a45a17f 100644
--- a/plugins/testng/pom.xml
+++ b/plugins/testng/pom.xml
@@ -55,6 +55,15 @@
<scope>provided</scope>
</dependency>
+ <!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
+ This is only necessary in tests-->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/struts/blob/243c92bf/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1437061..bafd12b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -597,7 +597,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.8.2</version>
+ <version>4.12</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
[4/6] struts git commit: WW-4510 Upgrade spring plugin dependencies
to spring version 4.x
Posted by jo...@apache.org.
WW-4510 Upgrade spring plugin dependencies to spring version 4.x
- Replace deprecated singleton="false" with scope="prototype"
- The boundary parameter needs to be in the header request
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/8aa389e3
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/8aa389e3
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/8aa389e3
Branch: refs/heads/master
Commit: 8aa389e3761e86eeb90ebfc3164fd2c56251a44d
Parents: c951b15
Author: Johannes Geppert <jo...@gmail.com>
Authored: Sun Jun 7 18:33:18 2015 +0200
Committer: Johannes Geppert <jo...@gmail.com>
Committed: Sun Jun 7 18:33:18 2015 +0200
----------------------------------------------------------------------
core/pom.xml | 14 ++++++++++++++
.../interceptor/FileUploadInterceptorTest.java | 10 ++++------
.../xwork2/spring/actionContext-spring.xml | 15 ++++++++-------
3 files changed, 26 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/8aa389e3/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 15fd2c5..34a1c55 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -303,5 +303,19 @@
<optional>true</optional>
</dependency>
+ <!-- The Servlet API mocks in Spring Framework 4.x only supports Servlet 3.0 and higher.
+ This is only necessary in tests-->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/struts/blob/8aa389e3/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java b/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java
index 9dbb114..870a600 100644
--- a/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java
+++ b/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java
@@ -213,7 +213,7 @@ public class FileUploadInterceptorTest extends StrutsInternalTestCase {
MockHttpServletRequest req = new MockHttpServletRequest();
req.setCharacterEncoding("text/html");
- req.setContentType("multipart/form-data; boundary=---1234");
+ req.addHeader("Content-type", "multipart/form-data");
req.setContent(null); // there is no content
MyFileupAction action = new MyFileupAction();
@@ -224,7 +224,7 @@ public class FileUploadInterceptorTest extends StrutsInternalTestCase {
Map param = new HashMap();
ActionContext.getContext().setParameters(param);
- ActionContext.getContext().put(ServletActionContext.HTTP_REQUEST, createMultipartRequest((HttpServletRequest) req, 2000));
+ ActionContext.getContext().put(ServletActionContext.HTTP_REQUEST, createMultipartRequest(req, 2000));
interceptor.intercept(mai);
@@ -234,8 +234,7 @@ public class FileUploadInterceptorTest extends StrutsInternalTestCase {
public void testSuccessUploadOfATextFileMultipartRequest() throws Exception {
MockHttpServletRequest req = new MockHttpServletRequest();
req.setCharacterEncoding("text/html");
- req.setContentType("multipart/form-data; boundary=---1234");
- req.addHeader("Content-type", "multipart/form-data");
+ req.addHeader("Content-type", "multipart/form-data; boundary=---1234");
// inspired by the unit tests for jakarta commons fileupload
String content = ("-----1234\r\n" +
@@ -291,8 +290,7 @@ public class FileUploadInterceptorTest extends StrutsInternalTestCase {
MockHttpServletRequest req = new MockHttpServletRequest();
req.setCharacterEncoding("text/html");
req.setMethod("POST");
- req.setContentType("multipart/form-data; boundary=" + bondary);
- req.addHeader("Content-type", "multipart/form-data");
+ req.addHeader("Content-type", "multipart/form-data; boundary=" + bondary);
StringBuilder content = new StringBuilder(128);
content.append(encodeTextFile(bondary, endline, "file", "test.html", "text/plain", plainContent));
content.append(encodeTextFile(bondary, endline, "file", "test1.html", "text/html", htmlContent));
http://git-wip-us.apache.org/repos/asf/struts/blob/8aa389e3/xwork-core/src/test/resources/com/opensymphony/xwork2/spring/actionContext-spring.xml
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/resources/com/opensymphony/xwork2/spring/actionContext-spring.xml b/xwork-core/src/test/resources/com/opensymphony/xwork2/spring/actionContext-spring.xml
index 4cc2284..02a4f33 100644
--- a/xwork-core/src/test/resources/com/opensymphony/xwork2/spring/actionContext-spring.xml
+++ b/xwork-core/src/test/resources/com/opensymphony/xwork2/spring/actionContext-spring.xml
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
-<beans>
- <bean id="simple-action" class="com.opensymphony.xwork2.SimpleAction" singleton="false"/>
+ <bean id="simple-action" class="com.opensymphony.xwork2.SimpleAction" scope="prototype"/>
- <bean id="dependency-action" class="com.opensymphony.xwork2.SimpleAction" singleton="false">
+ <bean id="dependency-action" class="com.opensymphony.xwork2.SimpleAction" scope="prototype">
<property name="blah"><value>injected</value></property>
</bean>
@@ -23,7 +25,7 @@
</property>
</bean>
- <bean id="auto-proxied-action" class="com.opensymphony.xwork2.SimpleAction" singleton="false"/>
+ <bean id="auto-proxied-action" class="com.opensymphony.xwork2.SimpleAction" scope="prototype"/>
<bean id="xwork-actions-proxy-creator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="proxyTargetClass"><value>true</value></property>
@@ -35,8 +37,7 @@
<property name="beanNames"><value>auto-proxied-action</value></property>
</bean>
- <bean id="springResult" class="com.opensymphony.xwork2.spring.SpringResult"
- init-method="initialize">
+ <bean id="springResult" class="com.opensymphony.xwork2.spring.SpringResult" init-method="initialize">
<property name="stringParameter" value="my string"/>
</bean>
</beans>