์น๊ณต๋ทฐ49 [์คํ๋ง] ํ์ผ, json ๊ฐ์ฒด ํ๊บผ๋ฒ์ ๋ฐ๊ธฐ ์ข ์ข @RestController ๋จ์์ ํ์ผ๊ณผ json ๊ฐ์ฒด๋ฅผ ๋์์ ๋ฐ์์ผํ ๊ฒฝ์ฐ๊ฐ ์๋ค. 1. postman ์ค์ (1) request-> body์ ํ์ ์ form-data๋ก ๋ณ๊ฒฝ (2) ๋ฐ์ด๋๋ฆฌ ํ์ผ์ ๋ณด๋ผ key๊ฐ์ File ํ์ ์ผ๋ก ๋ณ๊ฒฝ (3) json ํ์ ์ผ๋ก ๋ณด๋ผ key๊ฐ์๋ json ๊ตฌ์กฐ ๊ทธ๋๋ก ๋ฌธ์์ด๋ก. ์๋ฅผ ๋ค์ด { "uid": "test", "datasetName": "test1" } (4) Content Type์ ์ค์ ํ๋ค. ์๋ ๋งํฌ๋ฅผ ์ฐธ์กฐ ๋ง์ฝ Content Type์ด ๋ณด์ด์ง ์๋๋ค๋ฉด ์๋์ ... ๋ฒํผ์ ํด๋ฆญํ์ฌ ๋ณด์ด๊ฒ ํ์ Common MIME types - HTTP | MDN (mozilla.org) Common MIME types - HTTP | MDN This top.. 2022. 10. 31. java file ๊ฒฝ๋ก ๊ด๋ จ ํจ์๋ค File f = new File(path); System.out.println("f.getName() :" + f.getName()); System.out.println("f.getAbsolutePath() : " + f.getAbsolutePath()); try { System.out.println("f.getCanonicalPath() : " + f.getCanonicalPath()); System.out.println("f.getCanonicalFile() : " + f.getCanonicalFile()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("f.ge.. 2022. 10. 31. [centos7] mariadb ์ฌ์ฉ์ ๊ณ์ ๋น๋ฐ๋ฒํธ ์์ Server version: 10.4.26-MariaDB MariaDB Server $> mariadb MariaDB[(none)] use mysql MariaDB[mysql] set password for 'test'@'%'=password('1234'); //test ๊ณ์ ์ ๋ชจ๋ ์ ์ ๊ฒฝ๋ก์ ๋น๋ฐ๋ฒํธ๋ฅผ 1234๋ก ๋ณ๊ฒฝ MariaDB[mysql] set password for 'test'@'localhost'=password('1234'); //test ๊ณ์ ์ localhost ๊ฒฝ๋ก์ ๋น๋ฐ๋ฒํธ๋ฅผ 1234๋ก ๋ณ๊ฒฝ MariaDB[mysql] flush privileges; 2022. 9. 20. [spring] ๋ฆฌ์กํธ ๋น๋๋ ํ์ผ ์คํ๋ง์ ๋ถ์ด๊ธฐ (๋ฆฌ์์ค ํธ๋ค๋ฌ ์ด์ฉ) *๊ตฌ์ฑํ๊ฒฝ - ์ ์์ ๋ถํ๋ ์์ํฌ ์คํ๋ง ์ฌ์ฉ - @RestController ์ด์ฉ. jsp ์ฌ์ฉ์ํจ. - ํ๋ก ํธ๋ ๋ฆฌ์กํธ๋ก ์ฌ์ฉ 0. ๋ฆฌ์กํธ์์ ๋น๋๋ ๋๋ ํ ๋ฆฌ ํ์ผ์ ~/src/main/webapp/์ ๋ณต์ฌํ๋ค. ๋์ ๊ฒฝ์ฐ์๋ ๋๋ ํ ๋ฆฌ๋ช ์ด "dist" ์ด๋ฏ๋ก ์ ์ฒด ๊ฒฝ๋ก๋ ~/src/main/webapp/dist๊ฐ ๋๊ฒ ๋ค. 1. ๋ฆฌ์์ค ํธ๋ค๋ฌ ํด๋์ค ์ถ๊ฐ - ResourceConfig ํด๋์ค๋ฅผ ์ถ๊ฐ(์์์ ํด๋์ค๋ช ์ด๋ค) ํ๊ณ WebMvcConfigurer ์ธํฐํ์ด์ค๋ฅผ implementsํ๋ค. public class ResourceConfig implements WebMvcConfigurer { @Override public void addResourceHandlers(ResourceHandlerRegis.. 2022. 7. 13. ์ด์ 1 ยทยทยท 4 5 6 7 8 9 10 ยทยทยท 13 ๋ค์