From f796b25f338dd9d1dcdf2e7be7b4d2ffe84a84c4 Mon Sep 17 00:00:00 2001 From: "Donald J. Brown" Date: Sat, 19 May 2007 05:12:22 +0000 Subject: [PATCH] Improved how properties are loaded, added closing tr tag for debug tag WW-1746 WW-1712 git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@539688 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/struts2/config/PropertiesSettings.java | 3 ++- core/src/main/resources/template/simple/debug.ftl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/apache/struts2/config/PropertiesSettings.java b/core/src/main/java/org/apache/struts2/config/PropertiesSettings.java index ff34df6a5..cb92b8607 100644 --- a/core/src/main/java/org/apache/struts2/config/PropertiesSettings.java +++ b/core/src/main/java/org/apache/struts2/config/PropertiesSettings.java @@ -29,6 +29,7 @@ import java.util.Properties; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts2.StrutsException; +import org.apache.struts2.util.ClassLoaderUtils; import com.opensymphony.xwork2.util.location.LocatableProperties; import com.opensymphony.xwork2.util.location.Location; @@ -53,7 +54,7 @@ class PropertiesSettings extends Settings { */ public PropertiesSettings(String name) { - URL settingsUrl = Thread.currentThread().getContextClassLoader().getResource(name + ".properties"); + URL settingsUrl = ClassLoaderUtils.getResource(name + ".properties", getClass()); if (settingsUrl == null) { LOG.debug(name + ".properties missing"); diff --git a/core/src/main/resources/template/simple/debug.ftl b/core/src/main/resources/template/simple/debug.ftl index 19a3f35b3..ab59368a2 100644 --- a/core/src/main/resources/template/simple/debug.ftl +++ b/core/src/main/resources/template/simple/debug.ftl @@ -31,7 +31,7 @@ <#assign renderRow=false> <#list stackObject.value.keySet() as propertyName> - <#if renderRow==true><#else> <#assign renderRow=false> + <#if renderRow==true><#else> <#assign renderRow=false> ${propertyName} <#if stackObject.value.get(propertyName)?exists>${stackObject.value.get(propertyName).toString()}<#else>null