src/main/java/com/google/codeu/servlets/AboutMeServlet.java
/**
   * Responds with the "about me" section for a particular user.
   */
Responds with the "about me" section for a particular user.
Responds with the " about me " section for a particular user .
@Override
  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws IOException {
    response.setContentType("text/html");
    UserService userService = UserServiceFactory.getUserService();
    String user = userService.getCurrentUser().getEmail();
    if(user == null || user.equals("")) {
      response.getWriter().println("invalid user");
      return;
    }
    User userData = datastore.getUser(user);
    Gson gson = new Gson();
    String json = gson.toJson(userData);
    response.getWriter().println(json);
  }
@ Override public void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException { response . setContentType ( "text/html" ) ; UserService userService = UserServiceFactory . getUserService ( ) ; String user = userService . getCurrentUser ( ) . getEmail ( ) ; if ( user == null || user . equals ( "" ) ) { response . getWriter ( ) . println ( "invalid user" ) ; return ; } User userData = datastore . getUser ( user ) ; Gson gson = new Gson ( ) ; String json = gson . toJson ( userData ) ; response . getWriter ( ) . println ( json ) ; }
Responds with the "about me" section for a particular user.
Responds with the " about me " section for a particular user .
// Request is invalid, return empty response // if(userData == null || userData.getAboutMe() == null) { //   response.getWriter().println("no user found"); //   return; // } //System.out.println("The users name is " + userData.getName());