Esempio n. 1
0
 @RequestMapping(value = "/home/luis", method = RequestMethod.GET)
 public String luis(Model model) {
   Util.loginUsuario("*****@*****.**", "garbage1");
   User user = Util.getUserLogged();
   model.addAttribute("usuario", user.getUsername());
   model.addAttribute("password", user.getPassword());
   return "home";
 }
Esempio n. 2
0
  /** Simply selects the home view to render by returning its name. */
  @RequestMapping(value = "/home/client", method = RequestMethod.GET)
  public String home(Locale locale, Model model) {

    Date date = new Date();
    DateFormat dateFormat =
        DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);

    String formattedDate = dateFormat.format(date);

    User user = Util.getUserLogged();

    logger.info("usuario " + user.getUsername());
    logger.info("password " + user.getPassword());

    model.addAttribute("usuario", user.getUsername());
    model.addAttribute("password", user.getPassword());
    model.addAttribute("serverTime", formattedDate);

    return "home";
  }