@RequestMapping(value = "/project/p_list.do", method={RequestMethod.POST, RequestMethod.GET})
public ModelAndView login(HttpServletRequest request, HttpServletResponse response) throws Exception {
ModelAndView mv = new ModelAndView("test2");
String token = request.getParameter("token");
String page = request.getParameter("page");
String upStatu=request.getParameter("upStatu");
String statu=request.getParameter("statu");
String loginUrl = "http://10.0.2.14:8080/zfs_pg/project/p_list.do?";
String url = loginUrl + "token="+ token ;//+ "&page=" + page + "&upStatu=" + upStatu + "&statu=" + statu;
String result = null;
try {
result = HttpUtils.URLPost(url);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
System.out.println(result);
JSONObject jsonObject = new JSONObject(result);
int ret = jsonObject.getInt("ret");
List<Project> pList = new ArrayList<Project>();
if(ret==0){
JSONObject jsonObject2 = jsonObject.getJSONObject("data");
JSONArray plist = jsonObject2.getJSONArray("plist");
for (int i = 0; i < plist.length(); i++) {
JSONObject pC = plist.getJSONObject(i);
int pid = pC.getInt("pid");
String title = pC.getString("title");
String content = pC.getString("content");
String type = pC.getString("type");
String pTime = pC.getString("pTime");
String endTime = pC.getString("endTime");
String uName = pC.getString("uName");
Project pc = new Project();
pc.setPid(pid);
pc.setContent(content);
pc.setTitle(title);
//pc.setpTime(pTime);
pList.add(pc);
}
}else{
String msg = jsonObject.getString("msg");
}
mv.addObject("plist", pList);
return mv;
}