[Java] 컨트롤러에서 open api 호출하기
CORS 에러를 해결하기 위해 JSP문서에서 open api를 호출하는 대신, 컨트롤러에서 공공기관의 open api를 대신 호출시키고 데이터를 받아오는 방법을 사용했다 corsCatch.java @RequestMapping(value = "/test", method = { RequestMethod.POST },produces = "application/text; charset=utf8") public String test1(@RequestParam("url") String preurl) throws IOException { String preurl = preurl.replaceAll("&", "&"); //&로 넘어온 &를 치환 String result = null; URL url = null; ..
2022.12.12