@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setContentType("text/html");
		Cookie currentCookie = getCookie(request.getCookies());
		ServerContext.getInstance().setCurrentRequest(request);
		ServerContext.getInstance().setCurrentResponse(response);
		if(currentCookie != null){
			SessionCookie sc = new SessionCookie(currentCookie);
			ServerContext.getInstance().setSessionCookie(sc);
		}
		if(currentCookie == null){
			createSession();
		}else{
			if (request.getParameter("cmdRefresh")!=null){
				processRead();
			}
			else if(request.getParameter("cmdLogout")!=null){
				processLogout();
			}
			else if(request.getParameter("cmdReplace") != null){
				processUpdate();
			}else if(request.getParameter("cmdRefMEM") != null){
				try {
					SimpleDBManager.getInstance().refresh();
				} catch (SSMException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				processRead();
			}else if(request.getParameter("cmdKILL") != null){
				System.exit(0);
			}	
			else{
				processRead();
			}
		}

		//1. Get the response output stream 
		//2. send the new message and the new expiry time
		response = ServerContext.getInstance().getCurrentResponse();
		PrintWriter out = response.getWriter();
		log.info("AppServer.doGet() HTML"+ServerContext.getInstance().getResponseHTML());
		out.println(ServerContext.getInstance().getResponseHTML());


	}