日期:2014-05-19 浏览次数:20632 次
public void start(){ //获取HttpServletResponse对象response HttpServletResponse response=ServletActionContext.getResponse(); response.setContentType("text/html;charset=UTF-8"); //获取PrintWriter对象out PrintWriter out = null; try { out=response.getWriter(); } catch (IOException e) { e.printStackTrace(); } if(null!=parameter&&!parameter.isEmpty()){ try { String uid =UUID.randomUUID().toString(); //加入任务队列 等待加入数据库 ThreadPool tPool = ThreadPool.getInstance(); tPool.execute(new MytaskStart(statDao,parameter, uid)); [color=#FF0000]// MytaskStart是添加到数据库的一个任务类[/color] out.write(uid); } catch (JSONException e) { out.write("2"); //参数错误 e.printStackTrace(); } }else{ out.write("2"); //参数错误 } out.flush(); out.close(); }