if(!savefile.getParentFile().exists()){savefile.getParentFile().mkdirs();try{FileUtils.copyFile(imgFile,savefile);map.put("error",0);map.put("url",savefile);JSONObjectjso...
if (!savefile.getParentFile().exists()) {
savefile.getParentFile().mkdirs();
try {
FileUtils.copyFile(imgFile, savefile);
map.put("error", 0);
map.put("url", savefile);
JSONObject json = JSONObject.fromObject(map);
response.getOutputStream().print(json.toString());
} catch (IOException e) {
e.printStackTrace();
}
} else {
try {
FileUtils.copyFile(imgFile, savefile);
map.put("url", savefile);
map.put("error", 0);
JSONObject json = JSONObject.fromObject(map);
System.out.println(json);
response.getOutputStream().print(json.toString());
} catch (IOException e) {
} else {
map.put("error", 1);
map.put("message", "上传失败");
JSONObject json = JSONObject.fromObject(map);
try {
response.getOutputStream().print(json.toString());
} catch {
DeBug运行到JSONObject json = JSONObject.fromObject(map);就会进入DefaultActionInvocation.class,
kindeditor报的错误信息
type Exception report
message There is a cycle in the hierarchy!
description The server encountered an internal error that prevented it from fulfilling this request.
exception
net.sf.json.JSONException: There is a cycle in the hierarchy!
展开