*/
	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		String outputJson = "";
		PrintWriter out = response.getWriter();
		try {
			String method = request.getParameter("method").toLowerCase(
					Locale.ENGLISH);
			switch (CommandType.convertFormString(method)) {
			// Create a new user
			case CreateNewUser: {
				boolean result;
				String userName = request.getParameter("uname").toString()
						.trim();
				String userPass = request.getParameter("upass").toString()
						.trim();
				String nickName = request.getParameter("nickName").toString();
				String phone = request.getParameter("phone").toString().trim();
				int userType = Integer.parseInt(request.getParameter("type")
						.toString().trim());
				String profileImg = request.getParameter("profileImg")
						.toString().trim();
				if (userName == "" || userPass == "" || nickName == ""
						|| phone == "") {
					result = false;
				} else {
					String encryptedPass = desUtil.encryptStr(userPass);
					result = UserDAO.createUser(userName, encryptedPass,
							nickName, userType, phone, profileImg);
				}
				CommonObjectWrapper jsonResult = new CommonObjectWrapper();
				String message = "success to create a new user, The user name is:"
						+ userName;
				if (!result) {
					message = "Excpetion occurs, faild to ceate a new user";
				}
				jsonResult.setStatus(result);
				jsonResult.setMessage(message);
				outputJson = Gson.toJson(jsonResult);
				break;
			}
			// User Login
			case UserLogin: {
				String userName = request.getParameter("uname").toString()
						.trim();
				String userPass = request.getParameter("upass").toString()
						.trim();
				String encryptedUserPass = desUtil.encryptStr(userPass).trim();
				outputJson = doUserLogin(userName, encryptedUserPass);
				break;
			}
			// Update user
			case UpdateUser: {
				boolean result;
				int userId = Integer.parseInt(request.getParameter("uid")
						.toString().trim());
				String userName = request.getParameter("uname").toString()
						.trim();
				String nickName = request.getParameter("nickName").toString();
				String phone = request.getParameter("phone").toString().trim();
				if (userName == "" || nickName == "" || phone == "") {
					result = false;
				} else {
					result = UserDAO.updateUser(userId, userName, phone,
							nickName);
				}
				CommonObjectWrapper jsonResult = new CommonObjectWrapper();
				String message = "success to update the user, The user name is:"
						+ userName;
				if (!result) {
					message = "Excpetion occurs, faild to update the user";
				}
				jsonResult.setStatus(result);
				jsonResult.setMessage(message);
				outputJson = Gson.toJson(jsonResult);
				break;
			}
			// Reset user password
			case RestUserPass: {
				boolean result;
				int userId = Integer.parseInt(request.getParameter("uid")
						.toString().trim());
				String oldPass = request.getParameter("oldpass").toString()
						.trim();
				String newPass = request.getParameter("newpass").toString()
						.trim();
				if (oldPass == "" || newPass == "") {
					result = false;
				} else {
					String encryptedOldUserPass = desUtil.encryptStr(oldPass)
							.trim();
					String encryptedNewUserPass = desUtil.encryptStr(newPass)
							.trim();
					result = UserDAO.resetUserPass(userId,
							encryptedOldUserPass, encryptedNewUserPass);
				}
				CommonObjectWrapper jsonResult = new CommonObjectWrapper();
				String message = "success to reset the user pass, The user id is:"
						+ userId;
				if (!result) {
					message = "Excpetion occurs, faild to reset the user pass";
				}
				jsonResult.setStatus(result);
				jsonResult.setMessage(message);
				outputJson = Gson.toJson(jsonResult);
				break;
			}
			default:
				break;
			}
		} catch (Exception ex) {
			AppLogger.error(ex);
			CommonObjectWrapper jsonResult = handlerException(ex.toString());
			outputJson = Gson.toJson(jsonResult);
		}
		response.setContentType("application/json");
		response.setCharacterEncoding("utf-8");
		out.print(outputJson);
	}