@RequestMapping("/reminder") public String displayPage() { System.out.println("getting reminder page"); Authentication auth = SecurityContextHolder.getContext().getAuthentication(); CurrentUser currentUser = (CurrentUser) auth.getPrincipal(); // get user id return "redirect:/a/" + currentUser.getId() + "/reminder"; }