public void execute(WebScriptRequest req, WebScriptResponse res)
throws IOException {
try {
services.getNodeService().getStores();
} catch(Exception e) {
res.getWriter().write("\n\n"+ e.getMessage()+"\n\n"+ e.getStackTrace()+"\n\n"+ e.getCause()+"\n\n"+ "error class= "+e.getClass() + "\n\n\n\n\n\n");
}
try{
// build a json object
JSONObject obj = new JSONObject();
// put some data on it
obj.put("idEstado", "200");
obj.put("estado", "OK");
obj.put("uid", System.currentTimeMillis());
// build a JSON string and send it back
String jsonString = obj.toString();
res.getWriter().write(jsonString);
}
catch(JSONException e)
{
throw new WebScriptException("Unable to serialize JSON");
}
}
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.