Hi
First of all, this is great project and saved us a lot of time. Thank you very much.
I think I found a small error in AbstractJsonCommand class. When an exception occurs, the error message is not being written in the response and elFinder shows an error blaming the JSON response.
I solved the problem with this change:
` @OverRide
final public void execute(ElfinderStorage elfinderStorage, HttpServletRequest request, HttpServletResponse response) throws Exception {
JSONObject json = new JSONObject();
PrintWriter writer = response.getWriter();
try {
execute(elfinderStorage, request, json);
response.setContentType(APPLICATION_JSON_CHARSET_UTF_8);
json.write(writer);
writer.flush();
} catch (Exception e) {
logger.error("Unable to execute abstract json command", e);
json.put(ElFinderConstants.ELFINDER_JSON_RESPONSE_ERROR, e.getMessage());
json.write(writer);
writer.flush();
}
finally {
writer.close();
}
}`
As you can see, now the JSONObject is always written, and the exception getMessage is shown in the cliente side.
Thanks
Hi
First of all, this is great project and saved us a lot of time. Thank you very much.
I think I found a small error in AbstractJsonCommand class. When an exception occurs, the error message is not being written in the response and elFinder shows an error blaming the JSON response.
I solved the problem with this change:
` @OverRide
final public void execute(ElfinderStorage elfinderStorage, HttpServletRequest request, HttpServletResponse response) throws Exception {
JSONObject json = new JSONObject();
As you can see, now the JSONObject is always written, and the exception getMessage is shown in the cliente side.
Thanks