Spring JSON 출력

Spring JSON 출력

@RestController("apiNoticeController") @RequestMapping("/api/notice/") public class NoticeController{ @Autowired Private NoticeService service; // 서비스 객체 반환 @RequestMapping("list") public list getList() throws ClassNotFoundException, SQLException{ List list =serice.getList(1,"title",""); return list; } }

@RequestMapping("list") public Notice getList() throws ClassNotFoundException, SQLException{ List =serice.getList(1,"title",""); return list.get(0); }

스프링 JSON 출력을 위한 라이브러리 설정

//POM.xml 라이브러리 추가 com.fasterxml.jackson.core jackson-databind 2.11.2

from http://hhnee.tistory.com/118 by ccl(A) rewrite - 2021-12-22 23:01:10