svn commit: r564974 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r564974 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java

jleroux@apache.org
Author: jleroux
Date: Sat Aug 11 13:52:20 2007
New Revision: 564974

URL: http://svn.apache.org/viewvc?view=rev&rev=564974
Log:
A patch from Adrian Crum "Improved template rendering error message" (https://issues.apache.org/jira/browse/OFBIZ-1188)


Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java?view=diff&rev=564974&r1=564973&r2=564974
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/HtmlWidget.java Sat Aug 11 13:52:20 2007
@@ -28,6 +28,7 @@
 
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.UtilXml;
 import org.ofbiz.base.util.collections.MapStack;
 import org.ofbiz.base.util.string.FlexibleStringExpander;
@@ -72,6 +73,10 @@
         String location = locationExdr.expandString(context);
         //Debug.logInfo("Rendering template at location [" + location + "] with context: \n" + context, module);
         
+        if (UtilValidate.isEmpty(location)) {
+            throw new IllegalArgumentException("Template location is empty");
+        }
+        
         if (location.endsWith(".ftl")) {
             try {
                 FreeMarkerWorker.renderTemplateAtLocation(location, context, writer);
@@ -89,7 +94,7 @@
                 writeError(writer, errMsg);
             }
         } else {
-            throw new IllegalArgumentException("Rending not yet support for the tempalte at location: " + location);
+            throw new IllegalArgumentException("Rendering not yet supported for the template at location: " + location);
         }
     }
 
@@ -182,6 +187,7 @@
         }
     }
 }
+