예제 #1
0
  @RequestMapping("/user/{id}")
  public String whois(@PathVariable int id, Model model)
      throws NothingWasFoundException, SQLException {
    model.addAttribute("user", users.get(id));
    model.addAttribute("roles", users.getCurrentUserRoles());

    return "whois";
  }
예제 #2
0
  @Secured({"ROLE_USER", "ROLE_MODERATOR", "ROLE_ADMINISTRATOR"})
  @RequestMapping("/me")
  public String me(Model model)
      throws NothingWasFoundException, SQLException, NotLoggedInException {
    model.addAttribute("user", users.getCurrentUser());
    model.addAttribute("roles", users.getCurrentUserRoles());

    return "me";
  }
예제 #3
0
 @RequestMapping("/login")
 public String login(Model model, @RequestParam(required = false) Map<String, String> params) {
   model.addAttribute("haserror", params.containsKey("error"));
   model.addAttribute("roles", users.getCurrentUserRoles());
   return "login";
 }