首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

返回的json都报这个错,该怎么解决

2014-04-29 
返回的json都报这个错ProductManagerForm form (ProductManagerForm) getBaseForm(context)FormFile at

返回的json都报这个错
ProductManagerForm form = (ProductManagerForm) getBaseForm(context);
FormFile attachFile=form.getAttachFile();

if(attachFile.getFileSize()>10*1024*1024){
String result = "{"message":"failed"}";
context.getResponse().setContentType("application/json;charset=UTF-8");
context.getResponse().getWriter().write(result);
context.getResponse().getWriter().close();
}else{
String result ="{"message":"success"}";
context.getResponse().setContentType("application/json;charset=UTF-8");
context.getResponse().getWriter().write(result);
context.getResponse().getWriter().close();
}

为什么总是报这个问题Resource interpreted as Document but transferred with MIME type application/json
[解决办法]
你都不看问题报出来的意思,很明显是你文件的格式问题

热点排行