You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2014/03/28 21:51:28 UTC

[1/4] git commit: Bugfix: loadedFileUrls only contains the last one of urls with same filename in XmlConfigurationProvider

Repository: struts
Updated Branches:
  refs/heads/develop a6017dcac -> 1fae47dfc


Bugfix: loadedFileUrls only contains the last one of urls with same filename in XmlConfigurationProvider


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/e80658d0
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/e80658d0
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/e80658d0

Branch: refs/heads/develop
Commit: e80658d098b1af7101d4bb71db3b25923ebcd302
Parents: 3ceb3b9
Author: liang.liu <li...@dianping.com>
Authored: Mon Mar 17 16:23:43 2014 +0800
Committer: liang.liu <li...@dianping.com>
Committed: Mon Mar 17 16:23:43 2014 +0800

----------------------------------------------------------------------
 .../xwork2/config/providers/XmlConfigurationProvider.java          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/e80658d0/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java b/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
index 0939ab0..7a0a4e3 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProvider.java
@@ -1015,6 +1015,7 @@ public class XmlConfigurationProvider implements ConfigurationProvider {
                     in.setSystemId(url.toString());
 
                     docs.add(DomHelper.parse(in, dtdMappings));
+                    loadedFileUrls.add(url.toString());
                 } catch (XWorkException e) {
                     if (includeElement != null) {
                         throw new ConfigurationException("Unable to load " + url, e, includeElement);
@@ -1071,7 +1072,6 @@ public class XmlConfigurationProvider implements ConfigurationProvider {
                     }
                 }
                 finalDocs.add(doc);
-                loadedFileUrls.add(url.toString());
             }
 
             if (LOG.isDebugEnabled()) {


[3/4] git commit: WW-4289 Delegates initialisation of bean to Spring

Posted by lu...@apache.org.
WW-4289 Delegates initialisation of bean to Spring


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/e12262f0
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/e12262f0
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/e12262f0

Branch: refs/heads/develop
Commit: e12262f035109bfe18dc399f897aac6a1325f900
Parents: 272feec
Author: Lukasz Lenart <lu...@apache.org>
Authored: Fri Mar 28 15:38:45 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Fri Mar 28 15:38:45 2014 +0100

----------------------------------------------------------------------
 .../java/com/opensymphony/xwork2/spring/SpringObjectFactory.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/e12262f0/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 1ba7402..9ba065d 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
@@ -178,7 +178,7 @@ public class SpringObjectFactory extends ObjectFactory implements ApplicationCon
             } else {
                 bean = autoWiringFactory.autowire(clazz, AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, false);
                 bean = autoWiringFactory.applyBeanPostProcessorsBeforeInitialization(bean, bean.getClass().getName());
-                // We don't need to call the init-method since one won't be registered.
+                bean = autoWiringFactory.initializeBean(bean, bean.getClass().getName());
                 bean = autoWiringFactory.applyBeanPostProcessorsAfterInitialization(bean, bean.getClass().getName());
                 return autoWireBean(bean, autoWiringFactory);
             }


[2/4] git commit: WW-4169 Solves problem resolving path when action contains slashes

Posted by lu...@apache.org.
WW-4169 Solves problem resolving path when action contains slashes


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/272feecf
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/272feecf
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/272feecf

Branch: refs/heads/develop
Commit: 272feecfbd9bd69bf500af31541567f254dd0c6d
Parents: a6017dc
Author: Lukasz Lenart <lu...@apache.org>
Authored: Fri Mar 28 08:09:31 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Fri Mar 28 08:09:31 2014 +0100

----------------------------------------------------------------------
 .../views/freemarker/FreemarkerResult.java        | 18 +++++++++++++-----
 .../views/freemarker/FreeMarkerResultTest.java    |  3 +++
 2 files changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/272feecf/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java b/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java
index b8af3d6..3ded53b 100644
--- a/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java
+++ b/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java
@@ -39,7 +39,6 @@ import org.apache.commons.lang3.ObjectUtils;
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.StrutsStatics;
 import org.apache.struts2.dispatcher.StrutsResultSupport;
-import org.apache.struts2.views.util.ResourceUtil;
 
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
@@ -165,12 +164,21 @@ public class FreemarkerResult extends StrutsResultSupport {
         ActionContext ctx = invocation.getInvocationContext();
         HttpServletRequest req = (HttpServletRequest) ctx.get(ServletActionContext.HTTP_REQUEST);
 
-        if (!locationArg.startsWith("/")) {
-            String base = ResourceUtil.getResourceBase(req);
-            locationArg = base + "/" + locationArg;
+        String absoluteLocation;
+        if (location.startsWith("/")) {
+            absoluteLocation = location; 
+        } else { 
+            String namespace = invocation.getProxy().getNamespace();
+            if (namespace == null || namespace.length() == 0 || namespace.equals("/")) {
+                absoluteLocation = "/" + location;
+            } else if (namespace.startsWith("/")) {
+                absoluteLocation = namespace + "/" + location;
+            } else {
+                absoluteLocation = "/" + namespace + "/" + location;
+            }
         }
 
-        Template template = configuration.getTemplate(locationArg, deduceLocale());
+        Template template = configuration.getTemplate(absoluteLocation, deduceLocale());
         TemplateModel model = createModel();
 
         // Give subclasses a chance to hook into preprocessing

http://git-wip-us.apache.org/repos/asf/struts/blob/272feecf/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java b/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java
index d721826..060b927 100644
--- a/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java
+++ b/core/src/test/java/org/apache/struts2/views/freemarker/FreeMarkerResultTest.java
@@ -22,7 +22,9 @@
 package org.apache.struts2.views.freemarker;
 
 import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.ActionProxy;
 import com.opensymphony.xwork2.mock.MockActionInvocation;
+import com.opensymphony.xwork2.mock.MockActionProxy;
 import com.opensymphony.xwork2.util.ClassLoaderUtil;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory;
@@ -164,6 +166,7 @@ public class FreeMarkerResultTest extends StrutsInternalTestCase {
         invocation = new MockActionInvocation();
         invocation.setStack(stack);
         invocation.setInvocationContext(context);
+        invocation.setProxy(new MockActionProxy());
         servletContext.setRealPath(new File(FreeMarkerResultTest.class.getResource(
                 "someFreeMarkerFile.ftl").toURI()).toURL().getFile());
     }


[4/4] git commit: WW-4302 XmlConfigurationProvider.loadedFileUrls observs all loaded files

Posted by lu...@apache.org.
WW-4302 XmlConfigurationProvider.loadedFileUrls observs all loaded files


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/1fae47df
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/1fae47df
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/1fae47df

Branch: refs/heads/develop
Commit: 1fae47dfc6c79624488f838e3cc8790fb2d00ae8
Parents: e12262f e80658d
Author: Lukasz Lenart <lu...@apache.org>
Authored: Fri Mar 28 21:47:45 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Fri Mar 28 21:47:45 2014 +0100

----------------------------------------------------------------------
 .../xwork2/config/providers/XmlConfigurationProvider.java          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------