Solved

Usnig Java Interfaces in ColdFusion

Posted on 2008-09-30
1
256 Views
Last Modified: 2013-12-24
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

0
Comment
Question by:onaled777
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
onaled777 earned 0 total points
ID: 22606029
Solution Below:
		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 = Session.HtCreativeGroups.keys();
			while ( keys.hasMoreElements() )
   			{ 
   				key = keys.nextElement();
   				creativeGroup =  Session.HtCreativeGroups.get(key);
   				writeOutput( key & " " & creativeGroup );
   				writeOutput("<BR>");
   			} 
			
		}

Open in new window

0

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question