Revision: 905
http://stripes.svn.sourceforge.net/stripes/?rev=905&view=rev
Author: bengunter
Date: 2008-05-12 11:27:02 -0700 (Mon, 12 May 2008)
Log Message:
-----------
A true fix for STS-527 and STS-540. After executing each lifecycle stage that
generally produces validation errors (binding and validation, custom
validation, event handler execution), fill in any new validation errors so they
can be used by interceptors that run after the current stage. Removed the null
check from LocalizableError that was added to avoid the NPE caused by not doing
the above. (We want to know if it happens in the future.) Removed the call in
DispatcherServlet to fillInValidationErrors(..) that was done after execution
of the final stage since that will happen as the stage is executing now.
Modified Paths:
--------------
trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherHelper.java
trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherServlet.java
trunk/stripes/src/net/sourceforge/stripes/validation/LocalizableError.java
Modified:
trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherHelper.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherHelper.java
2008-05-12 15:25:05 UTC (rev 904)
+++ trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherHelper.java
2008-05-12 18:27:02 UTC (rev 905)
@@ -192,6 +192,7 @@
if (doBind) {
ActionBeanPropertyBinder binder =
config.getActionBeanPropertyBinder();
binder.bind(ctx.getActionBean(),
ctx.getActionBeanContext(), doValidate);
+ fillInValidationErrors(ctx);
}
return null;
}
@@ -247,6 +248,7 @@
}
}
+ fillInValidationErrors(ctx);
return null;
}
});
@@ -449,6 +451,7 @@
"returned: ", returnValue);
}
+ fillInValidationErrors(ctx);
return null;
}
});
Modified:
trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherServlet.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherServlet.java
2008-05-12 15:25:05 UTC (rev 904)
+++ trunk/stripes/src/net/sourceforge/stripes/controller/DispatcherServlet.java
2008-05-12 18:27:02 UTC (rev 905)
@@ -163,11 +163,8 @@
resolution = handleValidationErrors(ctx);
if (resolution == null) {
- // And finally(ish) invoking of the event
handler
+ // And finally invoking of the event
handler
resolution = invokeEventHandler(ctx);
-
- // If the event produced errors, fill them
in
-
DispatcherHelper.fillInValidationErrors(ctx);
}
}
}
Modified:
trunk/stripes/src/net/sourceforge/stripes/validation/LocalizableError.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/validation/LocalizableError.java
2008-05-12 15:25:05 UTC (rev 904)
+++ trunk/stripes/src/net/sourceforge/stripes/validation/LocalizableError.java
2008-05-12 18:27:02 UTC (rev 905)
@@ -88,11 +88,8 @@
*/
@Override
protected String getMessageTemplate(Locale locale) {
- String template = null;
-
- if (getBeanclass() != null) {
- template = LocalizationUtility.getErrorMessage(locale,
getBeanclass().getName() + "." + messageKey);
- }
+ String template = LocalizationUtility.getErrorMessage(locale,
getBeanclass().getName() + "." + messageKey);
+
if (template == null) {
template = LocalizationUtility.getErrorMessage(locale,
getActionPath() + "." + 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