Code example for Principal

Methods: getName

0
	private UserDao userDaoImpl;
	@Inject 
	NotificationClientImpl notificationClientImpl;
	@RequestMapping(value = "/", method = RequestMethod.GET) 
	public String services(Principal currentUser, Model model) {
		model.addAttribute("messageNotification", notificationClientImpl.getNotification(currentUser.getName()));
		model.addAttribute("profileImage", userDaoImpl.getByUserName(currentUser.getName()).getProfileImage());
		model.addAttribute("searchForm", new SearchForm());
		return "profile"; 
	} 
 
	 
}