Calling Packed java in application scopes

David Vu1
Kilo Expert

Hi talent,

I rewrite a code which write in global to my application :
var globalMap = new Packages.java.util.HashMap();

But it reponse that :


Use of Packages calls is not permitted in scoped applications

Has anyone experienced it before?


Thanks,Hao Duong

10 REPLIES 10

Hi ctomasi,
Firstly, I really appreciate your help in resolving the problem, ( I have already seen many videos by you, that's so great! Thanks again )



About my issue, I try to make call Hashmap method to used it in evaluators :



var evaluator = new GlideScopedEvaluator();


var gMap = new Packages.java.util.HashMap();



gMap.put("context", this);


evaluator.evaluateStringWithGlobals("(" + this.definition.setup + ").call(context)", gMap);



Thanks,


Thanks. Let me see what I can find. Stay tuned.



(and thank you for the kind words.)


Hi Chuck, been awhile since you posted this, but I am running into the same problem as the OP. If we can't use the native Java HashMap in scoped applications, what do you suggest as an alternative?



Thanks!


I haven't gone through all the latest API calls lately... have you taken a look at GlideDigest? Let me know if you find anything useful there.


sabell2012
Mega Sage
Mega Sage

Hao:



Not sure what the answer is on this.   I piled up onto the same problem when trying to implement java.lang.Object.



So, summation:   It appears you will not be able to use java.<<anything>> inside of scoped apps.



I will let you know when/if I find a way around this roadblock.



Steven.