for (int i = 0
temp = message.getJSONObject(i).get("serviceflow").toString()
if(temp.indexOf(".") == -1){
speedline[i] = Integer.parseInt(temp)
}else{
speedline[i] = Integer.parseInt(temp.substring(0,temp.indexOf(".")))
}
// speedline[i] = Integer.parseInt(message.getJSONObject(i).get("serviceflow").toString().split(".")[0])
System.out.println("speedline["+i+"]:" + speedline[i])
}
package com.zte.anyservice.iam.action;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import net.sf.json.JSONObject;
import com.zte.anyservice.iam.common.CommonUtil;
import com.zte.anyservice.iam.service.RequestConnectService;
import com.zte.anyservice.support.struts.AjaxActionSupport;
@SuppressWarnings("serial")
public class RequestConnectAction extends AjaxActionSupport {
@Resource
private RequestConnectService requestConnectService;
private List dateList;
public String init() {
dateList = new ArrayList();
return "init";
}
public String query(){
try {
Map data = new HashMap<String, String>();
List<String> result = new ArrayList<String>(Arrays.asList(new String[] {"9","10","11","12","13","14","15"}));
List<String> msg = new ArrayList<String>(Arrays.asList(new String[] {"9","10","11","12","13","14","15"}));
data.put("result", result);
data.put("msg", msg);
JSONObject json = JSONObject.fromObject(data);
String jsonStr = json.toString();
CommonUtil.writeJson(jsonStr);
} catch (Exception e) {
}
return "success";
}
public List getDateList() {
return dateList;
}
public void setDateList(List dateList) {
this.dateList = dateList;
}
}