์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- ์ฐ์ ์์ ํ
- ๋งต
- thymeleaf
- dfs
- dynamic debugging
- java
- ์๋ฎฌ๋ ์ด์
- OS
- ์ด๋ถ ํ์
- BFS
- ๋ฐฑํธ๋ํน
- ์์ ์ ๋ ฌ
- ๋์ ํฉ
- ๋ฐ์ดํฌ์คํธ๋ผ
- ์ต๋จ ๊ฒฝ๋ก
- CVE
- ์ฌ๊ท
- ์คํ
- ๋ฌธ์์ด
- Spring
- DP
- GCP
- c++
- ๊ทธ๋ฆฌ๋
- JPA
- ๊ตฌํ
- web
- ๋ถํ ์ ๋ณต
- error
- Reversing
- Today
- Total
๋ชฉ๋ก๐๐ปโ๏ธ ๊ธฐ๋ณธํ๋ จ (32)
hades

๐จ ์๋ฌ๋งจ ์์ input์ธ ํ์ฌ ๋น๋ฐ๋ฒํธ๋ฅผ ์ฌ๋ฐ๋ฅด์ง ์๊ฒ ์ ๋ ฅํ๊ณ , ๋ณ๊ฒฝ ์ Controller์์ BindingResult์ ์๋ฌ๋ฅผ ๋ํด์ ์๋ฌ ๋ฉ์ธ์ง๋ฅผ ๋ํ๋ด๊ณ ์ถ์๋ค. ํ์ง๋ง, ๋ณ๊ฒฝ ์์๋ ์๋ฌด๋ฐ ์๋ฌ ๋ฉ์ธ์ง๊ฐ ๋ํ๋์ง ์๋๋ค. ์ ์ด๋ฐ ๊ฒ์ผ๊น? ๐ ๋ถ์@PostMapping("/mypage/change")public String changePassword(@Validated @ModelAttribute(name = "passwordDto") PasswordDto passwordDto, BindingResult bindingResult, HttpServletRequest request, Model model){ HttpSession session = request.getSession();..

๐จ ์๋ฌ์นํจ3 ๊ฒ์๊ธ์ ์ง์ฐ๊ณ ์ถ์ด์ ์ญ์ ๋ฅผ ๋๋ฅด๋ฉด, ์๋์ ๊ฐ์ด ์นํจ1์ด ์ง์์ก๋ค. action์ ๊ฒฝ๋ก๋ ์ ๋๋ก ๋ ๊ฒ์ ํ์ธํ๋๋ฐ, ์ ์ด๋ฐ ์ผ์ด ์ผ์ด๋๋ ๊ฒ์ผ๊น? ๐ ๋ถ์ ์์ ์ญ์ ๋ฌธ์ ๋ ๊ฒ์๊ธ์ ๋์ดํ ๋, th:each๋ฅผ ์ฌ์ฉํ์๊ณ , ์์ ๊ณผ ์ญ์ ๋ฒํผ์ ๋ฐฐ์นํ๋ ๊ณผ์ ์์ form์ id๋ฅผ ์ฌ์ฉํ๋๋ฐ, ์ด id๊ฐ ๊ฒ์๊ธ๋ง๋ค ๋ชจ๋ ๊ฐ๊ฒ ๋์ด ๋งจ ์์ ์๋ ๊ฒ์๊ธ์ด ์ง์์ง ๊ฒ์ด์๋ค. ๐ ํด๊ฒฐ ์์ ..
๐จ ์๋ฌA collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance ๐ ๋ถ์์๋ฌ๋ฅผ ๊ทธ๋๋ก ํด์ํด๋ณด๋ฉด, cascade="all-delete-orphan" ์ต์ ์ด ์๋ ์ปฌ๋ ์ ์ด ๋์ด์ ์ํฐํฐ ๊ฐ์ฒด์ ์ํด ์ฐธ์กฐ๋์ง ์๋๋ค๊ณ ํ๋ค. ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ ๋ถ๋ถ์ธ Post๋ ๋ค์๊ณผ ๊ฐ๋ค.@Entity@Getter@Setterpublic class Post { @Id @GeneratedValue @Column(name = "POST_ID") private Long id; private String comment; @OneToMany(mappedBy = "post", c..
๐จ ์๋ฌNo static resource food/foodinfo/%EB%8B%AD%EA%B0%88%EB%B9%84. ๐ ๋ถ์๋ ์ด ๋ ์์ด ๋ฑ์ฅํ๋ค. ๋ง์ง๋ง ๋ถ๋ถ์ ๋ฉ๋ด ์ด๋ฆ์ ๊ทธ๋๋ก ์ ๋ฌํ๋๋ฐ, ์ ๋ฌ ๋ฌธ์ ์ธ๊ฐ ์ถ์ด์ Url Encoding ์ฒ๋ฆฌ๋ ํด์ฃผ์๋๋ฐ ์ฌ์ ํ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ค. ๋ฌธ์ ๋ ๊ฒฝ๋ก ์์์ ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถ์ด ์ด๋ฃจ์ด์ ธ์ผ ํ๋ค๋ ๊ฒ์ด์๋ค. ์ปจํธ๋กค๋ฌ์์๋ /food/foodInfo/๋ก ์ค์ ํ๋๋ฐ, /food/foodinfo๋ก ์ ๋ฌํ๊ธฐ ๋๋ฌธ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ค. ๐ ํด๊ฒฐ๋์๋ฌธ์์ ์ ์ํ์ฌ ์ฌ๋ฐ๋ฅด๊ฒ ๋ฐ๊ฟ์ค๋ค.

๋ณธ ๊ธ์ ํ๋ก์ ํธ๋ฅผ ์งํํ๋ฉด์, AI์ ์ง๋ฌธ์ ํ๊ณ ์๋ต์ ๋ฐ์์ผ ํ๋ ์๋น์ค๋ฅผ ๊ตฌํํ๊ธฐ ์ํด AI api๋ฅผ ํ์ตํ๋ฉด์ ์์ฑํ๋ ๊ธ์ด๋ค. Spring์์๋ AI๋ฅผ ๋งค์ฐ ์ฝ๊ฒ ์ง์ํด์ฃผ๋ dependency๊ฐ ์๋ค. ์ ํ๋ธ์ ๋งํฌ๋ ํ์ํ๊ธฐ ๋๋ฌธ์ ๊ฐ์ ๊ตฌ๊ธ ์๋น์ค์ธ Gemini AI๋ฅผ ์ฌ์ฉํ๊ธฐ๋ก ํ๋ค. ์ฒ์, build.gradle์์ Edit Starters๋ก ์๋์ ๊ฐ์ด Gemini AI๋ฅผ ์ถ๊ฐํ๊ณ ํ๋ค.ํ์ง๋ง, dependency๊ฐ ์ธ์๋์ง ์๊ณ , ๋นจ๊ฐ์ค ์ฒ์ง๊ฐ ๋์๋ค. ์บ์ ์ญ์ , ์ฌ๋น๋ ๋ฑ ์ฌ๋ฌ๊ฐ์ง ๋ฐฉ๋ฒ์ ์๋ํด๋ณด์์ง๋ง ํด๊ฒฐํ ์ ์์๋ค. (๊น์ ๋นก์นจ) ํน์๋ ํด์ Spring Initilizr๋ฅผ ์ด์ฉํ์ฌ Gemini๋ฅผ ์ถ๊ฐํ ์๋ก์ด ํ๋ก์ ํธ๋ฅผ ๋ง๋ค๊ณ , build.gradle์ ํ์ธํด๋ณด์๋ค. ์๋กญ..
๐จ ์๋ฌCaused by: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Vertex AI API has not been used in project before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/aiplatform.googleapis.com/overview?project then retry. ๐ ๋ถ์Google Cloud Platform์์ API๋ฅผ ์ฌ์ฉํ๋ ๊ณผ์ ์์ ์ ๊ทผ ์ ํ ์๋ฌ๊ฐ ๋ฐ์ํ์๋ค. ๊ธฐ์กด์ API๋ฅผ ๋ฑ๋กํ๋ค๊ณ ์๊ฐํ๋๋ฐ, ์๋ฌ๊ฐ ์น์ ํ๊ฒ ์จ์ค ์ฃผ์๋ก ์ ์ํ๋ ์๋์๋ค. ๐ ํด๊ฒฐAPI๋ฅผ ๋ฑ๋กํ๋ค๊ณ ์๊ฐํ๋๋ฐ, ๋ฑ๋ก๋์ง ..
๐จ ์๋ฌCaused by: java.io.IOException: Your default credentials were not found. To set up Application Default Credentials for your environment, see https://cloud.google.com/docs/authentication/external/set-up-adc ๐ ๋ถ์Google Cloud์ ์๋ ํ๋ก์ ํธ์ ์๋ API๋ฅผ ์ด์ฉํ๊ธฐ ์ํด ์ ๊ทผํ๋ ๊ณผ์ ์์ ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์๋ค. Credential์ด ํ์ํ๋ฐ, ์ฐพ์ ์ ์๋ค๊ณ ํ๋ค. ์๋ฌ์์ ์น์ ํ๊ฒ ์๋ ค์ค ์ฃผ์๋ก ๊ฐ์ ์ค์ ํ๋ฉด ๋ ๋ฏํ๋ค. ๐ ํด๊ฒฐ๋ก์ปฌ ๊ฐ๋ฐ ํ๊ฒฝ์์ ์์ ์ค์ด์๊ธฐ์ ํด๋น ๋ถ๋ถ์ Google ๊ณ์ ์ผ๋ก ADC ๊ตฌ์ฑ์ ๋ณด๊ณ , ๋ฐ..

ํ๋ก์ ํธ๋ฅผ ์งํํ๋ ๋์ค, ํ์ผ ์ ๋ก๋ ๊ธฐ๋ฅ์ด ํ์ํ์ฌ ํ์ต ํ, ํ๋ก์ ํธ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์ ๋ฆฌํ ๊ธ์ด๋ค. ๋ณธ์ธ์ ๊ฒ์๊ธ์ ์ด๋ฏธ์ง ํ์ผ์ ์ฌ๋ฆฌ๋ ๊ฒ์ ๋ชฉํ๋ก ํ์๊ณ , ๊ทธ๋ก ์ธํด ๊ฒ์๊ธ๊ณผ ํ์ผ ๊ฐ์ ์ฐ๊ด๊ด๊ณ๊ฐ ์๋ค. Multipart๋ฌธ์, ์ซ์ ๋ฐ์ดํฐ๋ ๊ธฐ๋ณธ์ ์ผ๋ก application/x-www-form-urlencoded ๋ฐฉ์์ ์ด์ฉํ๋ค. ํ์ง๋ง, ํ์ผ์ ์ด๋ค๊ณผ ๋ค๋ฅด๊ฒ ๋ฐ์ด๋๋ฆฌ ๋ฐ์ดํฐ๋ก ๋ณด๋ด์ผ ํ๋ค. ๋ฌธ์, ์ซ์, ํ์ผ์ ๋์์ ๋ณด๋ด์ผ ํ๋ ๊ฒฝ์ฐ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ค. ์ด๋ฅผ ํด๊ฒฐํ๋ ๊ฒ์ด Form ํ๊ทธ์ enctype="multipart/form-data" ๋ฅผ ์ถ๊ฐํ๋ ๊ฒ์ด๋ค. Content-Disposition์ ์ํด ๊ตฌ๋ถ๋๊ณ , ํ์ผ์ ์ถ๊ฐ์ ์ผ๋ก filename๊ณผ Content-Type์ด ์ถ๊ฐ๋๊ณ ๋ฐ์ด๋๋ฆฌ ๋ฐ..
๐จ ์๋ฌModel has no value for key foodId ๐ ๋ถ์@PostMapping("post/delete/{id}")public String deletePost(@PathVariable(name = "id") Long id, RedirectAttributes redirectAttributes){ Post post = postService.findPost(id); Long foodId = post.getFood().getId(); postService.remove(id); return "redirect:/food/foodInfo/{foodId}"}id๋ก post๋ฅผ ์ฐพ๊ณ , post์ ์ฐ๊ฒฐ๋ foodId๋ฅผ ์ฐพ์ redirect ๊ฒฝ๋ก ์์ ๋ฃ์ด์ฃผ์๋ค. @GetMappin..
๐จ ์๋ฌCaused by: org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: "/posts/${post.id}" (template: "loginHome" - line 15, col 12) ๐ ๋ถ์post.id๋ฅผ ์ด์ฉํ์ฌ ๋์ ์ผ๋ก ๊ฒฝ๋ก๋ฅผ ์ง์ ํ๋ ค๊ณ ํ๋๋ฐ, /posts/${post.id}๋ฅผ ํ์ฑํ ์ ์๋ค๊ณ ํ๋ค. ๐ ํด๊ฒฐ์๋ ๋ ํผ๋ฐ์ค ๋ธ๋ก๊ทธ๋ฅผ ์ฐธ๊ณ ํ๋, ${}๋ก ๊ฐ์ธ์ง ๋ณ์๋ง์ด ์๋๋ผ ๋ค๋ฅธ ๋ฌธ์์ด์ด ์๋ ๊ฒฝ์ฐ์๋ ๋ํ๊ธฐ๋ก ์๊ฑฐ๋, | |๋ก ๊ฐ์ธ์ฃผ์ด์ผ ํ๋ค. ๐ ๋ ํผ๋ฐ์คhttps://velog.io/@susu1991/Thymeleaf#%EB%A6%AC%ED%84%B0%EB%9F%B4 Thymelea..