tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshcanfi...@apache.org
Subject svn commit: r1142135 - /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/TapestryFilter.java
Date Sat, 02 Jul 2011 00:49:17 GMT
Author: joshcanfield
Date: Sat Jul  2 00:49:17 2011
New Revision: 1142135

URL: http://svn.apache.org/viewvc?rev=1142135&view=rev
Log:
Added support for adding tapestry.%s-modules via SystemProperties in addition to Servlet Context
Properties

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/TapestryFilter.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/TapestryFilter.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/TapestryFilter.java?rev=1142135&r1=1142134&r2=1142135&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/TapestryFilter.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/TapestryFilter.java
Sat Jul  2 00:49:17 2011
@@ -18,6 +18,7 @@ import org.apache.tapestry5.internal.Ser
 import org.apache.tapestry5.internal.TapestryAppInitializer;
 import org.apache.tapestry5.ioc.Registry;
 import org.apache.tapestry5.ioc.def.ModuleDef;
+import org.apache.tapestry5.ioc.internal.services.SystemPropertiesSymbolProvider;
 import org.apache.tapestry5.ioc.services.SymbolProvider;
 import org.apache.tapestry5.services.HttpServletRequestHandler;
 import org.apache.tapestry5.services.ServletApplicationInitializer;
@@ -79,11 +80,23 @@ public class TapestryFilter implements F
     {
         config = filterConfig;
 
-        ServletContext context = config.getServletContext();
+        final ServletContext context = config.getServletContext();
 
         String filterName = config.getFilterName();
 
-        SymbolProvider provider = new ServletContextSymbolProvider(context);
+        SymbolProvider provider = new SymbolProvider()
+        {
+            SymbolProvider contextProvider = new ServletContextSymbolProvider(context);
+            SymbolProvider systemProvider = new SystemPropertiesSymbolProvider();
+
+            public String valueForSymbol(String symbolName)
+            {
+                String contextValue = contextProvider.valueForSymbol(symbolName);
+                if ( contextValue != null ) return contextValue;
+
+                return systemProvider.valueForSymbol(symbolName);
+            }
+        };
 
         String executionMode = System.getProperty("tapestry.execution-mode", "production");
 



Mime
View raw message