( which works perfectly if I write this in my browser bar) but when I want to access to my profile it return me a USer nto found, because Spring boot sees it as null
@GetMapping("/profile") public String getUserProfile(Model model, @RequestParam(required = false) String email){ AppUser user = repo.findByEmail(email); System.out.println("the email is :" + email); if(user != null){ model.addAttribute("user", user); }else{ model.addAttribute("error", "User not found"); } return "profile"; }
@GetMapping("/profile") public String getUserProfile(Model model, @RequestParam(required = false) String email){ AppUser user = repo.findByEmail(email); System.out.println("the email is :" + email); if(user != null){ model.addAttribute("user", user); }else{ model.addAttribute("error", "User not found"); } return "profile"; }