struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject struts git commit: Adds support for deprecated param name
Date Fri, 08 Apr 2016 08:26:56 GMT
Repository: struts
Updated Branches:
  refs/heads/support-2-3 5ce807aae -> 865f1f278


Adds support for deprecated param name


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

Branch: refs/heads/support-2-3
Commit: 865f1f27842233f5081b6ce60f45c9100b374e45
Parents: 5ce807a
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Fri Apr 8 10:26:21 2016 +0200
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Fri Apr 8 10:26:21 2016 +0200

----------------------------------------------------------------------
 .../apache/struts2/tiles/StrutsTilesContainerFactory.java |  3 +++
 .../org/apache/struts2/tiles/StrutsTilesInitializer.java  | 10 ++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/865f1f27/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
----------------------------------------------------------------------
diff --git a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
index 871ccf3..0ed8c5c 100644
--- a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesContainerFactory.java
@@ -221,6 +221,9 @@ public class StrutsTilesContainerFactory extends BasicTilesContainerFactory
{
         if (params.containsKey(DefinitionsFactory.DEFINITIONS_CONFIG)) {
             return TextParseUtil.commaDelimitedStringToSet(params.get(DefinitionsFactory.DEFINITIONS_CONFIG));
         }
+        if (params.containsKey(BasicTilesContainer.DEFINITIONS_CONFIG)) {
+            return TextParseUtil.commaDelimitedStringToSet(params.get(BasicTilesContainer.DEFINITIONS_CONFIG));
+        }
         return TextParseUtil.commaDelimitedStringToSet(TILES_DEFAULT_PATTERN);
     }
 

http://git-wip-us.apache.org/repos/asf/struts/blob/865f1f27/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesInitializer.java
----------------------------------------------------------------------
diff --git a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesInitializer.java
b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesInitializer.java
index c667104..aff1426 100644
--- a/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesInitializer.java
+++ b/plugins/tiles/src/main/java/org/apache/struts2/tiles/StrutsTilesInitializer.java
@@ -24,6 +24,7 @@ import com.opensymphony.xwork2.util.logging.LoggerFactory;
 import org.apache.tiles.TilesApplicationContext;
 import org.apache.tiles.definition.DefinitionsFactory;
 import org.apache.tiles.factory.AbstractTilesContainerFactory;
+import org.apache.tiles.impl.BasicTilesContainer;
 import org.apache.tiles.servlet.context.ServletTilesApplicationContext;
 import org.apache.tiles.startup.AbstractTilesInitializer;
 
@@ -37,15 +38,20 @@ public class StrutsTilesInitializer extends AbstractTilesInitializer {
     protected TilesApplicationContext createTilesApplicationContext(TilesApplicationContext
preliminaryContext) {
         ServletContext servletContext = (ServletContext) preliminaryContext.getContext();
 
-        if (servletContext.getInitParameter(DefinitionsFactory.DEFINITIONS_CONFIG) != null)
{
+        if (isStaticDefinition(servletContext)) {
             LOG.trace("Found definitions config in web.xml, using standard Servlet support
....");
             return new ServletTilesApplicationContext(servletContext);
         } else {
-            LOG.trace("Initializing Tiles wildcard support ...");
+            LOG.trace("Initializing Struts Tiles wildcard support ...");
             return new StrutsWildcardServletTilesApplicationContext(servletContext);
         }
     }
 
+    protected boolean isStaticDefinition(ServletContext servletContext) {
+        return servletContext.getInitParameter(DefinitionsFactory.DEFINITIONS_CONFIG) !=
null ||
+                servletContext.getInitParameter(BasicTilesContainer.DEFINITIONS_CONFIG) !=
null;
+    }
+
     @Override
     protected AbstractTilesContainerFactory createContainerFactory(TilesApplicationContext
context) {
         LOG.trace("Creating dedicated Struts factory to create Tiles container");


Mime
View raw message