onaled777
asked on
Usnig Java Interfaces in ColdFusion
Below i my attempt to use the java interface java.util.Enumeration. Because it is an interface and cannot be instantiated the code fails with the error:
Unable to find a constructor for class java.util.Enumeration that accepts parameters of type ( '' ).
How do I correct this.
Unable to find a constructor for class java.util.Enumeration that accepts parameters of type ( '' ).
How do I correct this.
If (IsDefined('URL.oid') and IsDefined('URL.crgid')) {
if (Not IsDefined('Session.HtCreativeGroups')){
ht = createObject('java','java.util.Hashtable').init();
Session.HtCreativeGroups = ht;
}
Session.HtCreativeGroups.put(URL.oid, URL.crgid);
keys = createObject('java','java.util.Enumeration').init();
keys = Session.HtCreativeGroups.keys();
while ( keys.hasMoreElements() )
{
key = JavaCast("keys.nextElement()", String);
creativeGroup = JavaCast("Session.HtCreativeGroups.get(key)", String);
writeOutput( key & " " & creativeGroups );
writeOutput("<BR>");
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.