HATEOAS 3단계 적용 질문입니다 !
386
작성한 질문수 3
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
섹션 4 Level3 단계의 REST API 구현을 위한 HATEOAS 적용에서 오류가 발생했습니다.
retrieveAllUsers
@GetMapping("/users")
public List<User> retrieveAllUsers() {
return service.findAll();
}
전체 조회 메서드는 잘 작동이 되는데
retrieveUser
@GetMapping("/users/{id}")
public EntityModel<User> retrieveUser(@PathVariable int id) {
User user = service.findOne(id);
if (user == null){
throw new UserNotFoundException(String.format("ID[%s] not found", id));
}
EntityModel<User> entityModel = EntityModel.of(user);
WebMvcLinkBuilder linkTo = linkTo(methodOn(this.getClass()).retrieveAllUsers());
entityModel.add(linkTo.withRel("all-users"));
return entityModel;
}

이런 오류가 발생했습니다.
어떻게 해결해야 할까요?
답변 1
JPA
0
71
1
jpa dependency를 추가하고 SecurityConfig클래스에서 오류가 납니다.
0
84
1
웹 브라우저 400 bad request
0
84
1
@Size는 되는데 @Past는 안 됩니다.
0
76
1
pdf 자료는 없나요?
0
92
2
locale 정보가 null 이면 무조건 messages_ko.properties이 호출 되는 문제
0
100
2
Swagger 강의, Unable to infer base url 이거 뜨시는 분들 도움되시라고
0
135
1
강의에서나온 화면 피피티
0
169
1
HelloWorldBean 관련 에러
0
194
2
Swagger API 3.x 오류..
0
230
1
java: variable message not initialized in the default constructor 에러는 어찌하면 좋을까요?
1
289
1
현재 GIT에 올리신 소스를 실행해봤습니다.
0
203
2
고양이 소리가 귀엽네요 !!
0
149
2
git에서 소스받고 실습중인데
0
127
1
post가 안되요
0
116
1
한국어 같은 경우 언어코드인 messages_ko.properties 로 생성하는게 더 좋지 않나요?
0
176
2
리턴타입으로서 EntityModel<User> 와 ResponseEntity질문
0
113
1
예외처리쪽 관련 질문있습니다.
0
165
2
엔티티가 바로 응답으로 나가도 되나요??
0
239
2
안녕하세여 Cannot invoke "co.kr.joneconsulting.resfulservice.repository.PostRepository.save(Object)" because "this.postRepository" is null
0
150
2
사용자 등록하고 나서 H2 에서 보면 신규 사용자의 password, ssn 이 null 로 되어 있습니다.
0
146
2
ApplictionContext 질문
0
199
2
롬북이 안먹히는것같아요
0
161
1
인텔리제이에서스프링부트 파일 실행하면
0
244
1





