You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mr...@apache.org on 2006/10/29 22:19:31 UTC

svn commit: r468999 - in /struts/struts2/trunk: assembly/pom.xml core/pom.xml core/src/main/java/org/apache/struts2/config/StrutsXmlConfigurationProvider.java

Author: mrdon
Date: Sun Oct 29 13:19:30 2006
New Revision: 468999

URL: http://svn.apache.org/viewvc?view=rev&rev=468999
Log:
Changed xwork dep to snapshot, fixed config files to only reload once
per request
WW-1483 

Modified:
    struts/struts2/trunk/assembly/pom.xml
    struts/struts2/trunk/core/pom.xml
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/StrutsXmlConfigurationProvider.java

Modified: struts/struts2/trunk/assembly/pom.xml
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/assembly/pom.xml?view=diff&rev=468999&r1=468998&r2=468999
==============================================================================
--- struts/struts2/trunk/assembly/pom.xml (original)
+++ struts/struts2/trunk/assembly/pom.xml Sun Oct 29 13:19:30 2006
@@ -103,7 +103,7 @@
                                     <groupId>opensymphony</groupId>
                                     <artifactId>xwork</artifactId>
                                     <classifier>javadoc</classifier>
-                                    <version>2.0-beta-1</version>
+                                    <version>2.0-SNAPSHOT</version>
                                 </artifactItem>
                             </artifactItems>
                             <outputDirectory>${project.build.directory}/xwork-apidocs</outputDirectory>

Modified: struts/struts2/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/pom.xml?view=diff&rev=468999&r1=468998&r2=468999
==============================================================================
--- struts/struts2/trunk/core/pom.xml (original)
+++ struts/struts2/trunk/core/pom.xml Sun Oct 29 13:19:30 2006
@@ -39,7 +39,7 @@
         <dependency>
             <groupId>opensymphony</groupId>
             <artifactId>xwork</artifactId>
-            <version>2.0-beta-1</version>
+            <version>2.0-SNAPSHOT</version>
         </dependency>
 
         <dependency>

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/StrutsXmlConfigurationProvider.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/StrutsXmlConfigurationProvider.java?view=diff&rev=468999&r1=468998&r2=468999
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/StrutsXmlConfigurationProvider.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/StrutsXmlConfigurationProvider.java Sun Oct 29 13:19:30 2006
@@ -17,6 +17,7 @@
 import org.apache.commons.logging.LogFactory;
 
 import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.config.Configuration;
 import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
 
 /**
@@ -27,6 +28,7 @@
     private static final Log LOG = LogFactory.getLog(StrutsXmlConfigurationProvider.class);
     private File baseDir = null;
     private String filename;
+    private String reloadKey;
 
     /** 
      * Constructs the configuration provider
@@ -46,6 +48,7 @@
     public StrutsXmlConfigurationProvider(String filename, boolean errorIfMissing) {
         super(filename, errorIfMissing);
         this.filename = filename;
+        reloadKey = "configurationReload-"+filename;
         Map<String,String> dtdMappings = new HashMap<String,String>(getDtdMappings());
         dtdMappings.put("-//Apache Software Foundation//DTD Struts Configuration 2.0//EN", "struts-2.0.dtd");
         setDtdMappings(dtdMappings);
@@ -54,6 +57,18 @@
             this.baseDir = file.getParentFile();
         }
     }
+    
+    
+
+    /* (non-Javadoc)
+     * @see com.opensymphony.xwork2.config.providers.XmlConfigurationProvider#init(com.opensymphony.xwork2.config.Configuration)
+     */
+    @Override
+    public void init(Configuration configuration) {
+        ActionContext ctx = ActionContext.getContext();
+        ctx.put(reloadKey, Boolean.TRUE);
+        super.init(configuration);
+    }
 
     /**
      * Look for the configuration file on the classpath and in the file system
@@ -106,9 +121,7 @@
     @Override
     public boolean needsReload() {
         ActionContext ctx = ActionContext.getContext();
-        String key = "configurationReload-"+filename;
-        if (ctx.get(key) == null) {
-            ctx.put(key, Boolean.TRUE);
+        if (ctx.get(reloadKey) == null) {
             return super.needsReload();
         }
         return false;