   private void doSaveProfile(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
      User currentUser = (User) request.getAttribute("user");
      Profile profile = Profile.findForUser(currentUser);
      if(profile == null) {
         profile = new Profile();
         Key key = KeyFactory.createKey(Profile.class.getSimpleName(), currentUser.getEmail());
         profile.setKey(key);
      }
      profile.setAboutMe(request.getParameter("profile.aboutMe"));
      profile.setUsername(request.getParameter("profile.username"));
      profile.setPets(request.getParameterValues("profile.pet"));
      profile.setGender(request.getParameter("profile.gender"));
      profile.setMaritalStatus(request.getParameter("profile.maritalStatus"));
      PersistenceManager pm = PMF.get().getPersistenceManager();
      try {
         pm.makePersistent(profile);         
      } finally {
         pm.close();
      }
      response.sendRedirect("/profile/mine");
   }

   private void doSaveProfile(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
      User currentUser = (User) request.getAttribute("user");
      Profile profile = Profile.findForUser(currentUser);
      if(profile == null) {
         profile = new Profile();
         Key key = KeyFactory.createKey(Profile.class.getSimpleName(), currentUser.getUserId());
         profile.setKey(key);
      }
      profile.setAboutMe(request.getParameter("profile.aboutMe"));
      profile.setUsername(request.getParameter("profile.username"));
      profile.setPets(request.getParameterValues("profile.pet"));
      profile.setGender(request.getParameter("profile.gender"));
      profile.setMaritalStatus(request.getParameter("profile.maritalStatus"));
      PersistenceManager pm = PMF.get().getPersistenceManager();
      try {
         pm.makePersistent(profile);         
      } finally {
         pm.close();
      }
      response.sendRedirect("/profile/mine");
   }
