
서버 -> 클라이언트한테 데이터를 전달하는 방법1. 응답용 DTO 생성 응답용 DTO 클래스를 만들고 객체를 생성해서객체의 변수에 값을 저장하고 컨트롤러의 메소드가 returm 해주면 알아서 json 형태로 변경해준다. 응답용 DTOpublic class ResponseDto { private int id; private String name; private String message; // getter, setter 생략}@RestController@RequestMapping("/test04")public class Test04Controller { @GetMapping("ex01") public ResponseDto ex01() { Respo..