Ejemplo n.º 1
0
  /**
   * Simply selects the home view to render by returning its name.
   *
   * @param request
   * @param mav
   * @return
   */
  @RequestMapping(
      value = {"/", "/home"},
      method = RequestMethod.GET)
  public ModelAndView home(HttpServletRequest request, ModelAndView mav) {

    String name = request.getUserPrincipal().getName();
    ManageUser mu = new ManageUser();
    User user = mu.getUser(name);
    mav.addObject("user", user);
    mav.setViewName("home");
    return mav;
  }