Spring (2) 썸네일형 리스트형 [Spring] @PathVariable을 통한 URI 설정 시 점(.) 이후의 값이 생략되는 현상 이메일 입력값에서 점(.) 이후의 값이 잘려서 넘어온다? 이메일 중복 확인 테스트가 계속 실패했다. 먼저 코드를 확인해보자. 아래 코드는 Controller 클래스의 메소드 그리고 해당 메소드의 테스트 코드이다. 구현 코드 @GetMapping("/email/{userEmail}") public ResponseEntity checkUserEmail(@PathVariable("userEmail") String userEmail) { try { service.isExistUserEmail(userEmail); } catch (EmailAlreadyExistsException e) { return new ResponseEntity(HttpStatus.CONFLICT); } return new ResponseE.. ambiguous handler methods mapped for... ambiguous handler methods mapped for... 말 그대로 요청 URI가 애매하기 때문이다. 애매한 이유는 중복되는 URI가 있기 때문일 것이다. 본인은 아래 코드를 통해 이 에러와 마주했다. @GetMapping("/exists/{userId}) public ResponseEntity checkUserId ... @GetMapping("/exists/{userEmail} public ResponseEntity checkUserEmail... 본인은 처음에 두 메소드의 URI가 서로 다르다고 생각했다. /exists/는 동일하지만 쿼리 스트링으로 들어가는 값이 다르기 때문에 다른 URI 아닌가? 하고 생각했다. 아니다. 두 메소드의 URI는 동일하다. /exists/ 까지가 URI.. 이전 1 다음