cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: rev 45990 - cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/binding
Date Mon, 13 Sep 2004 17:46:57 GMT
Author: tim
Date: Mon Sep 13 10:46:56 2004
New Revision: 45990

Modified:
   cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java
Log:
Make the widget-missing error in JXPathBindingBase a little clearer.


Modified: cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java
==============================================================================
--- cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java
(original)
+++ cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java
Mon Sep 13 10:46:56 2004
@@ -30,7 +30,7 @@
  * Jakarta Commons <a href="http://jakarta.apache.org/commons/jxpath/index.html">
  * JXPath package</a>.
  *
- * @version CVS $Id: JXPathBindingBase.java,v 1.6 2004/05/07 22:04:20 joerg Exp $
+ * @version CVS $Id$
  */
 public abstract class JXPathBindingBase implements Binding, LogEnabled {
 
@@ -118,10 +118,15 @@
         childWidget = parent.lookupWidget(id);
             
         if (childWidget == null) {
+            String containerId = parent.getRequestParameterName();
+            if(containerId == null || "".equals(containerId)) {
+                containerId = "top-level form-widget";
+            } else {
+                containerId = "container \"" + containerId + "\"";
+            }
             throw new RuntimeException(getClass().getName() + ": Widget \"" +
-                    id + "\" does not exist in container \"" +
-                    parent.getRequestParameterName() + "\" (" +
-                    parent.getLocation() + ").");
+                    id + "\" does not exist in the " + containerId +
+                    " (" + parent.getLocation() + ").");
         }
         
         return childWidget;

Mime
View raw message