Link to home
Start Free TrialLog in
Avatar of onaled777
onaled777Flag for United States of America

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.
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>");
 			} 
	
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of onaled777
onaled777
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial