/** * /get-by-email --> Return the id for the user having the passed email. * * @param email The email to search in the database. * @return The user id or a message error if the user is not found. */ @RequestMapping("/get-by-email") @ResponseBody public String getByEmail(String email) { String userId; try { User user = userDao.findByEmail(email); userId = String.valueOf(user.getId()); } catch (Exception ex) { return "User not found"; } return "The user id is: " + userId; }