public void queryTaskResult2() throws Exception {
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
PrintWriter out = response.getWriter();
String newsIdselect = request.getParameter("newsIdselect");
String taskname = request.getParameter("taskname");
String result = "{success:true,totalProperty: " + + ",root:[{";
String mmsAccessResult=null;
if (newsIdselect != null && !"".equals(newsIdselect)) {
List<AssessBeforeResult> abrList = assessBeforeResultService.findAssessResultByTaskId(Integer.valueOf(newsIdselect));
if(abrList!=null&&abrList.size()>)
{ for (int i = ; i < abrList.size(); i++) {
AssessBeforeResult abr = abrList.get(i);
if(abr.getSampleType()==)
{ System.out.println(abr.getMmsLeakage());
mmsAccessResult = "mmsTaskId:'" + newsIdselect
+ "',mmsResultId:'"+ abr.getId()
+ "',mmsTaskName:'" + taskname
+ "',mmsPrecision:'" + abr.getMmsPrecision()+ "%'"
+ " ,mmsRecall:'" + abr.getMmsRecall()+ "%'"
+ " ,mmsErrorrate:'" + abr.getMmsErrorrate()+ "%'"
//+ " ,mmsLeakage:'" + abr.getMmsLeakage()+ "%'";
+ " ,mmsLeakage:'11'"; }
}
}
}
System.out.println(mmsAccessResult);
if(mmsAccessResult!=null)
{
result+=mmsAccessResult;
} result+=",textPrecision:'"+ ""
+ "',textRecall:'"+ ""
+ "',textErrorrate:'"+ ""
+ "',textLeakage:'"+ ""; result+="'}]}"; String updateString = "{success:true,totalProperty: 1,root: [{"
+ "mmsTaskId:'"+""
+ "',mmsResultId:'"+ ""
+ "',mmsTaskName:'"+ ""
+ "',mmsPrecision:'"+ ""
+ "',mmsRecall:'"+ ""
+ "',mmsErrorrate:'"+ ""
+ "',mmsLeakage:'"+ "" + "',textPrecision:'"+ ""
+ "',textRecall:'"+ ""
+ "',textErrorrate:'"+ ""
+ "',textLeakage:'"+ ""
+ "'}]}"; System.out.println(result);
System.out.println(updateString); //out.println(updateString);
out.println(result);
out.flush();
out.close();
}

这个问题我调试了好几个小时,就因为前面多了一个“  ’ ”这个符号,输出样例如下

{
success: true,
totalProperty: ,
root: [
{
mmsTaskId: '',
mmsResultId: '',
mmsTaskName: '???é?????è???????????è???¨?é??è????°',
mmsPrecision: '25.0%',
mmsRecall: '16.67%',
mmsErrorrate: '0.0%',
mmsLeakage: '83.33%'',
textPrecision: '',
textRecall: '',
textErrorrate: '',
textLeakage: ''
}
]
}{
success: true,
totalProperty: ,
root: [
{
mmsTaskId: '',
mmsResultId: '',
mmsTaskName: '',
mmsPrecision: '',
mmsRecall: '',
mmsErrorrate: '',
mmsLeakage: '',
textPrecision: '',
textRecall: '',
textErrorrate: '',
textLeakage: ''
}
]
}
05-08 14:55