|
@@ -51,7 +51,6 @@ public class QuChenAction extends ActionSupport{
|
|
|
questionManager.save(entity);
|
|
questionManager.save(entity);
|
|
|
String resultJson=buildResultJson(entity);
|
|
String resultJson=buildResultJson(entity);
|
|
|
response.getWriter().write(resultJson);
|
|
response.getWriter().write(resultJson);
|
|
|
- //返回各部分ID
|
|
|
|
|
}catch (Exception e) {
|
|
}catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
response.getWriter().write("error");
|
|
response.getWriter().write("error");
|
|
@@ -166,7 +165,6 @@ public class QuChenAction extends ActionSupport{
|
|
|
public static String buildResultJson(Question entity){
|
|
public static String buildResultJson(Question entity){
|
|
|
//{id:'null',quItems:[{id:'null',title:'null'},{id:'null',title:'null'}]}
|
|
//{id:'null',quItems:[{id:'null',title:'null'},{id:'null',title:'null'}]}
|
|
|
StringBuffer strBuf=new StringBuffer();
|
|
StringBuffer strBuf=new StringBuffer();
|
|
|
- //{id:'',quItems:[{id:'',title:''},{id:'',title:''}]}
|
|
|
|
|
strBuf.append("{id:'").append(entity.getId());
|
|
strBuf.append("{id:'").append(entity.getId());
|
|
|
strBuf.append("',orderById:");
|
|
strBuf.append("',orderById:");
|
|
|
strBuf.append(entity.getOrderById());
|
|
strBuf.append(entity.getOrderById());
|
|
@@ -179,7 +177,6 @@ public class QuChenAction extends ActionSupport{
|
|
|
}
|
|
}
|
|
|
int strLen=strBuf.length();
|
|
int strLen=strBuf.length();
|
|
|
if(strBuf.lastIndexOf(",")==(strLen-1)){
|
|
if(strBuf.lastIndexOf(",")==(strLen-1)){
|
|
|
-// strBuf.substring(0, strLen-1);
|
|
|
|
|
strBuf.replace(strLen-1, strLen, "");
|
|
strBuf.replace(strLen-1, strLen, "");
|
|
|
}
|
|
}
|
|
|
strBuf.append("]");
|
|
strBuf.append("]");
|
|
@@ -193,7 +190,6 @@ public class QuChenAction extends ActionSupport{
|
|
|
}
|
|
}
|
|
|
strLen=strBuf.length();
|
|
strLen=strBuf.length();
|
|
|
if(strBuf.lastIndexOf(",")==(strLen-1)){
|
|
if(strBuf.lastIndexOf(",")==(strLen-1)){
|
|
|
-// strBuf.substring(0, strLen-1);
|
|
|
|
|
strBuf.replace(strLen-1, strLen, "");
|
|
strBuf.replace(strLen-1, strLen, "");
|
|
|
}
|
|
}
|
|
|
strBuf.append("]");
|
|
strBuf.append("]");
|
|
@@ -209,11 +205,9 @@ public class QuChenAction extends ActionSupport{
|
|
|
}
|
|
}
|
|
|
strLen=strBuf.length();
|
|
strLen=strBuf.length();
|
|
|
if(strBuf.lastIndexOf(",")==(strLen-1)){
|
|
if(strBuf.lastIndexOf(",")==(strLen-1)){
|
|
|
-// strBuf.substring(0, strLen-1);
|
|
|
|
|
strBuf.replace(strLen-1, strLen, "");
|
|
strBuf.replace(strLen-1, strLen, "");
|
|
|
}
|
|
}
|
|
|
strBuf.append("]}");
|
|
strBuf.append("]}");
|
|
|
-// System.out.println(strBuf.toString());
|
|
|
|
|
return strBuf.toString();
|
|
return strBuf.toString();
|
|
|
}
|
|
}
|
|
|
|
|
|