Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1.5-SNAPSHOT
-
None
Description
Date: Fri, 28 Jul 2006 20:06:49 +0200
From: "MT3 MTCube" <mt3.mtcube@gmail.com>
To: dev@myfaces.apache.org
Subject: ValidateCompareToTag
We have used the <s:validateCompareTo> with the "comparator" attribute, we
have inserted a value binding (like comparator=#
) in the
attribute but we have received this exception:
java.lang.ClassCastException: comparator must be type interface
java.util.Comparator but is type class java.lang.String
at
org.apache.myfaces.custom.comparetovalidator.CompareToValidator.createComparator
(CompareToValidator.java:347)
at
org.apache.myfaces.custom.comparetovalidator.CompareToValidator.validate(
CompareToValidator.java:292)
even if we get a java.util.Comparator from the bean.
We have solved the problem with this patch:
Index:
C:/current/tomahawk/sandbox/core/src/main/java/org/apache/myfaces/custom/comparetovalidator/ValidateCompareToTag.java
===================================================================
—
C:/current/tomahawk/sandbox/core/src/main/java/org/apache/myfaces/custom/comparetovalidator/ValidateCompareToTag.java
(revision 425405)
+++
C:/current/tomahawk/sandbox/core/src/main/java/org/apache/myfaces/custom/comparetovalidator/ValidateCompareToTag.java
(working copy)
@@ -71,7 +71,7 @@
if (_comparator != null)
if (_foreignComponentName != null)
with this correction the "comparator" property receives the object instead
at first it receives a String (the cause of the later exception).
Is it correct or we have used the comparator attribute in a wrong way?
Thanks to all,
Mt3