Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to fill HashMap<String,String>?
dzish
Hi,
do you know how to fill HashMap in javascript before sending to java method?
Java method has head
static methodName(Map<String, String> map)
I tried:
var map = new HashMap();
map.put("key,"Johnny");
MyClass.methodName(map);
I have Exception in calling java method that I have HashMap with Object not String. When I tried to change header to methodName(Map<Object, Object> map) and cast to (String) I received ClassCastException.
thanks
Find more posts tagged with
Comments
JasonW
Try
var map = new Packages.java.util.HashMap();
map.put(String("key"),String("Johnny"));
BTW is this just a typo
map.put("key,"Johnny");
Key is not fully quoted
Jason
dzish
thank you Jason,
that's it. Yes it was typo.