|
From: <jue...@we...> - 2004-06-02 23:31:34
|
It's indeed a bug! Just fixed - will make it into 1.0.2.
=20
Juergen
=20
________________________________
Von: spr...@li... im Auftrag =
von Seth Ladd
Gesendet: Mi 02.06.2004 23:52
An: spr...@li...
Betreff: [Springframework-developer] Possible Bug in =
DefaultMessageSourceResolver
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
I think this usage should be possible, so please let me know if this
isn't supported.
I am writing some custom validation in onBindAndValidate, and am
rejecting a field in a map. The specific code is:
errors.rejectValue("accepted['"+agencyName+"']",
~ "errors.required", new Object[] {
~ new DefaultMessageSourceResolvable(
~ new String[]{"signatureCommand.accept.dept."+agencyName})
~ }, null);
My bean looks like:
public class Command {
~ public Map getAccepted();
}
However, when I attempt to reject the field accepted['tax'], I receive a
NPE:
java.lang.NullPointerException
~ at
org.springframework.validation.DefaultMessageCodesResolver.resolveMes
sageCodes(DefaultMessageCodesResolver.java:103)
~ at
org.springframework.validation.BindException.resolveMessageCodes(Bind
Exception.java:163)
~ at
org.springframework.validation.BindException.rejectValue(BindExceptio
n.java:152)
~ at
com.hic.eboss.web.SignatureController.onBindAndValidate(SignatureCont
roller.java:143)
This is because the Class of accepted['tax'] was not found (because its
value is null). There was a similar problem w/ null values in a Map
with the registering of custom property editors.
I believe that DefaultMessageCodesResolver should just handle the case
where the Class is null.
Hope that helps,
Thanks!
Seth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3-nr1 (Windows XP)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAvkwKKZsFSwtW+wIRAnTzAJ415fKDkJsvj6ZdvKnD3x3LSRbjPgCfXSZs
SQpDKva/NQVTp60gFSZKrSM=3D
=3DUbsm
-----END PGP SIGNATURE-----
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|