Revision: 933
          http://stripes.svn.sourceforge.net/stripes/?rev=933&view=rev
Author:   bengunter
Date:     2008-05-23 11:25:56 -0700 (Fri, 23 May 2008)

Log Message:
-----------
Fixed STS-527 again. Freddy already fixed it once, but I "unfixed" it because I 
thought it was just obscuring a different, deeper problem. Turns out, there are 
situations where LocalizableError can legitimately not have a beanclass or 
actionPath. E.g., if they are added from an exception handler. We need to 
account for that possibility.

Modified Paths:
--------------
    trunk/stripes/src/net/sourceforge/stripes/validation/LocalizableError.java

Modified: 
trunk/stripes/src/net/sourceforge/stripes/validation/LocalizableError.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/validation/LocalizableError.java  
2008-05-23 13:16:01 UTC (rev 932)
+++ trunk/stripes/src/net/sourceforge/stripes/validation/LocalizableError.java  
2008-05-23 18:25:56 UTC (rev 933)
@@ -14,6 +14,7 @@
  */
 package net.sourceforge.stripes.validation;
 
+import net.sourceforge.stripes.action.ActionBean;
 import net.sourceforge.stripes.localization.LocalizationUtility;
 
 import java.util.Locale;
@@ -88,10 +89,17 @@
      */
     @Override
     protected String getMessageTemplate(Locale locale) {
-        String template = LocalizationUtility.getErrorMessage(locale, 
getBeanclass().getName() + "." + messageKey);
+        String template = null;
 
+        Class<? extends ActionBean> beanclass = getBeanclass();
+        if (beanclass != null) {
+            template = LocalizationUtility.getErrorMessage(locale, 
beanclass.getName() + "." + messageKey);
+        }
         if (template == null) {
-            template = LocalizationUtility.getErrorMessage(locale, 
getActionPath() + "." + messageKey);
+            String actionPath = getActionPath();
+            if (actionPath != null) {
+                template = LocalizationUtility.getErrorMessage(locale, 
actionPath + "." + messageKey);
+            }
         }
         if (template == null) {
             template = LocalizationUtility.getErrorMessage(locale, messageKey);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to