I'm trying to create a jsonarray from a Map in java. I'm passing it in to a javascript variable. But i don't know why the mac and status are blank, any help much appreciated.
what i need:
[{"12345":{"mac":"FFFFFFFF", "status":"ON"}]
What i am getting with my current code:
[{"12345":{}]
Here is my code,
public class Details {
public JSONArray getResult() {
return JSONArray.fromObject(this.det);
}
public Map det = new HashMap();
public results() {
ResultSet rs;
det.put(rs.getString(1), new NodeDetails(rs.getString(2), rs.getString(3));
}
class NodeDetails {
public final String MAC;
public final String status;
public NodeDetails(final String ma,final String st) {
this.MAC = ma;
this.status = st;
}
}
}