content: package algorithm;
  
  import java.io.IOException;
  import java.io.PrintWriter;
  
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
  import util.Utils;
  
  /**
   * Servlet implementation class Monitor
   */
  @WebServlet("/Monitor")
  public class Monitor extends HttpServlet {
  	private Logger log = LoggerFactory.getLogger(getClass());
  	private static final long serialVersionUID = 1L;
  	
      /**
       * @see HttpServlet#HttpServlet()
       */
      public Monitor() {
          super();
      }
  
  	/**
  	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
  	 */
  	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  		String appId = request.getParameter("APPID");
  //		log.info("appId:"+appId);
  		String progress = Utils.getAppStatus(appId);
  //		log.info("appId:"+appId+",进度："+progress);
  		
  		// 打印输出
  		PrintWriter out = response.getWriter();
  		out.write(progress);
  		out.flush();
  		
  		
  	}
  
  	/**
  	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
  	 */
  	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  		doGet(request, response);
  	}
  
  }
  