JavaBean2JSON transform = new JavaBean2JSON();
try {
// FIXME: this only checks for String and not primitive types
if (!(result instanceof java.lang.String)) {
jsonResponse.put("result", transform.toJSON(result));
} else {
jsonResponse.put("result", result);
}
jsonResponse.putOpt("id", id);