click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r956736 - /click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java
Date Mon, 21 Jun 2010 23:41:54 GMT
Author: sabob
Date: Mon Jun 21 23:41:54 2010
New Revision: 956736

URL: http://svn.apache.org/viewvc?rev=956736&view=rev
Log:
improved exception message if page class cannot be loaded

Modified:
    click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java

Modified: click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java?rev=956736&r1=956735&r2=956736&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java (original)
+++ click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java Mon Jun
21 23:41:54 2010
@@ -1561,7 +1561,6 @@ public class XmlConfigService implements
 
                 Ognl.setValue(name, logService, value);
             }
-
         }
 
         logService.onInit(getServletContext());
@@ -1972,7 +1971,25 @@ public class XmlConfigService implements
                 throw new RuntimeException(msg);
             }
 
-            pageClass = ClickUtils.classForName(value);
+            try {
+
+                pageClass = ClickUtils.classForName(value);
+
+            } catch (ClassNotFoundException cnfe) {
+
+                // If a pagesPackage was delcared provide a descriptive error message
+                if (StringUtils.isNotBlank(pagesPackage)) {
+                    String msg = "No class was found for the Page classname: '"
+                        + value + "'. Please note that Click automatically adds"
+                        + " the given package '" + pagesPackage + "' to page"
+                        + " classnames. If you need to specify an absolute"
+                        + " classname declare a <pages>...</pages> element"
+                        + " without a package attribute.";
+                    throw new RuntimeException(msg, cnfe);
+                } else {
+                    throw cnfe;
+                }
+            }
 
             if (!Page.class.isAssignableFrom(pageClass)) {
                 String msg = "Page class " + value



Mime
View raw message