-
Notifications
You must be signed in to change notification settings - Fork 1
/
rss2.xml
488 lines (239 loc) ยท 145 KB
/
rss2.xml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>์ผ๋ง์ฐฌ ๊ฐ๋ฐ์์ ๋ธ๋ก๊ทธ</title>
<link>https://sowon-dev.github.io/</link>
<atom:link href="https://sowon-dev.github.io/rss2.xml" rel="self" type="application/rss+xml"/>
<description>devlog</description>
<pubDate>Fri, 03 Jan 2025 03:06:13 GMT</pubDate>
<generator>http://hexo.io/</generator>
<item>
<title>์น ์บ์ฑ๋ฐฉ์ง</title>
<link>https://sowon-dev.github.io/2025/01/02/250103cahe-control/</link>
<guid>https://sowon-dev.github.io/2025/01/02/250103cahe-control/</guid>
<pubDate>Thu, 02 Jan 2025 16:54:36 GMT</pubDate>
<description><p>ํ
์คํธ๊น์ง ํ์ธ ๋คํ๊ณ ์ค์๋ฒ๋ฐฐํฌํ๋๋ฐ jsํจ์๋ฅผ ๋ชป์ฐพ๋๋ค๋ ์๋ฌ๊ฐ ๋ด๋ค.<br>๋ฐ๋ js๋ฅผ ๋ชป ์ฐพ๋ ๋ฌธ์ ์๋ค. </p></description>
<content:encoded><![CDATA[<p>ํ
์คํธ๊น์ง ํ์ธ ๋คํ๊ณ ์ค์๋ฒ๋ฐฐํฌํ๋๋ฐ jsํจ์๋ฅผ ๋ชป์ฐพ๋๋ค๋ ์๋ฌ๊ฐ ๋ด๋ค.<br>๋ฐ๋ js๋ฅผ ๋ชป ์ฐพ๋ ๋ฌธ์ ์๋ค. </p><a id="more"></a><p>์น ์บ์ฑ๋ฌธ์ ๋ ๊ฐ๋ ฅ์๋ก๊ณ ์นจ์ ํ๋ฉด ํด๊ฒฐ๋์ง๋ง ์ผ๋ฐ ์ฌ์ฉ์๋ ๊ทธ๋ง์ ๋ ๋ณต์กํ ์ ์๋ค.<br>๋ฐ๋ผ์ ์บ์ฑ์ ๋ฐฉ์งํด์ผํ๋ค.</p><h1 id="์บ์ฑ"><a href="#์บ์ฑ" class="headerlink" title="์บ์ฑ"></a>์บ์ฑ</h1><p>์บ์๋ฅผ ํ์ธํด๋ณด๋ ํ์ด์ง๋ง๋ค ์ธ์ธํ๊ฒ ์ฒ๋ฆฌ๋์ด์์๋ค.<br>์๋ฌ๊ฐ ๋ฐ์ํ ๊ณณ์ ์ฃผ๋ฌธํ๊ธฐ ํ์ด์ง์๋ค. </p><ul><li>cache-control: private</li><li><a href="https://developer.mozilla.org/ko/docs/Web/HTTP/Headers/Cache-Control">Cache-Control</a>;</li></ul><p><br><br><br></p><h1 id="ํด๊ฒฐ๋ฒ1-๋ฉํ๋ฐ์ดํฐ-์ค์ "><a href="#ํด๊ฒฐ๋ฒ1-๋ฉํ๋ฐ์ดํฐ-์ค์ " class="headerlink" title="ํด๊ฒฐ๋ฒ1. ๋ฉํ๋ฐ์ดํฐ ์ค์ "></a>ํด๊ฒฐ๋ฒ1. ๋ฉํ๋ฐ์ดํฐ ์ค์ </h1><p>๋ฉํ๋ฐ์ดํฐ์ ์๋ ์ค์ ์ธ ์ถ๊ฐํ๋ฉด ์บ์ฑ์ ๋ฐฉ์งํ ์ ์์ง๋ง ์์ ์ด ๋ณ๋ก ์๋ ์ฌ์ดํธ๋ ํ์ด์ง์ ์ค์ ํ๋ ๊ฒฝ์ฐ ๋ถํ์ํ ํธ๋ํฝ์ ๋ง์ด ์ ๋ฐํ ์ ์๋ค.</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"></span><br></pre></td></tr></table></figure><p>๋ถํ์ํ๊ฒ ํธ๋ํฝ์ ์ ๋ฐํ๋ฉด ์ฌ์ดํธ๊ฐ ๋๋ ค์ง๋ฏ๋ก ์ ์ ๋ฆฌ์์ค์ ๋ฒ์ ์ ๋ช
์ํ๊ธฐ๋ก ํ๋ค.</p><p><br><br><br></p><h1 id="ํด๊ฒฐ๋ฒ2-์ ์ -๋ฆฌ์์-๋ฒ์ -๋ช
์"><a href="#ํด๊ฒฐ๋ฒ2-์ ์ -๋ฆฌ์์-๋ฒ์ -๋ช
์" class="headerlink" title="ํด๊ฒฐ๋ฒ2. ์ ์ ๋ฆฌ์์ ๋ฒ์ ๋ช
์"></a>ํด๊ฒฐ๋ฒ2. ์ ์ ๋ฆฌ์์ ๋ฒ์ ๋ช
์</h1><p>์ฟผ๋ฆฌ์คํธ๋ง์ ๋ฒ์ ์ ์ง์ ๋ช
์ํด์ค๋ ๋์ง๋ง ๋ ๊ฑฐ์๋ ์ปดํฌ๋ํธ๊ฐ ์ ํ ๋ถ๋ฆฌ๋์ง์์ ํ๋ฉด์ด์๋ค.<br>ํน์ ๋ถ๋ถ 1๊ฐ๋ง ์์ ํ๋๋ผ๋ ๊ด๋ จ๋ ํ์ด์ง๊ฐ 20๊ฐ๊ฐ ๋์ด๊ฐ์ ๋ถํ์ํ๊ฒ ๋ณต๋ถ์ ํด์ผ๋งํ๋ค.<br>๋ฐ๋ผ์ ์์ฃผ ์ฌ์ฉํ๋ common jsํ์ผ์ด๋ cssํ์ผ์๋ง ์ฟผ๋ฆฌ์คํธ๋ง์ผ๋ก ํญ์ ์๋ก ๋ถ๋ฌ์ค๋๋ก ํ๋ค.</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// Header.jsp๋ ๊ณตํต.jsp์ ๋ช
์</span></span><br><span class="line"><c:<span class="keyword">set</span> var="dateNow" value="<%=new java.util.Date()%>" /></span><br><span class="line"><c:<span class="keyword">set</span> var="verStamp"><fmt:formatDate value="${dateNow}<span class="string">" pattern="</span>yyyyMMddhhmmss<span class="string">" /></c:set></span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">// ๊ฐ jsp ํ๋ฉด์๋จ์ ๋ฒ์ ๋ช
์</span></span><br><span class="line"><span class="string"><script type="</span>text/javascript<span class="string">" src="</span>/js/common.js?ver=${verStamp}<span class="string">" ></script></span></span><br></pre></td></tr></table></figure>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/CS/">CS</category>
<comments>https://sowon-dev.github.io/2025/01/02/250103cahe-control/#disqus_thread</comments>
</item>
<item>
<title>[OS/WINDOW]๋ฐฐํฌํ ์๋ฒ์ฌ์์์ batch์ ์๋์ฐ ์ค์ผ์ค๋ฌ ํ์ฉํ๊ธฐ</title>
<link>https://sowon-dev.github.io/2024/12/08/241209batch-service-restart/</link>
<guid>https://sowon-dev.github.io/2024/12/08/241209batch-service-restart/</guid>
<pubDate>Sun, 08 Dec 2024 20:26:35 GMT</pubDate>
<description><p>์ด์งํ ํ์ฌ๋ ๋ฐฐํฌ๊ด๋ฆฌ์๊ฐ ๋ฐ๋ก ์๋ค.</p></description>
<content:encoded><![CDATA[<p>์ด์งํ ํ์ฌ๋ ๋ฐฐํฌ๊ด๋ฆฌ์๊ฐ ๋ฐ๋ก ์๋ค.</p><a id="more"></a><p>์ด์ ํ์ฌ์์๋ ์์
ํ ์ฌ๋์ด ๋ฐฐํฌํ๊ฑฐ๋ ๋ชจ์์ ํ๊บผ๋ฒ์ ์ฑ๊ณผ์ฅ๋์ด ํด์ฃผ์
จ๋๋ฐ ์ฌ๊ธฐ์๋ ๊ฐ์ด ์
์ฌํ ๋๋ฆฌ๋์ด ๋ฐฐํฌ๋ด๋น์์ด๋ค.<br>๋ฐฐํฌ๋ ์ฌ์ฉ์๊ฐ ์๋ ์๊ฐ์ ํด์ผํ๊ธฐ์ ๋๋ฆฌ๋์ด ์กฐ๊ธ์ฉ ์ผ๊ทผํ๊ฒ ๋๋ ๊ฒ ์์ํ๊ณ ์ด๋ป๊ฒํ๋ฉด ๋์๋๋ฆด์์์๊น ๊ณ ๋ฏผํ๋ค๊ฐ ๋ฐฐํฌ ํ ์์
๋ฌผ ํ
์คํธ๋ฅผ ๊ฐ์ด ๋๋ ํ์๊ณ ๋ง์๋๋ฆฌ๋ ๊ฑธ๋ก ๋ง์กฑํด์ผ๋งํ๋ค.<br>ํ์ง๋ง ์ค๋ ์ ์ฌ์๊ฐ์ ํ์ฅ๋์ด ๋ ์ข์ ๋ฐฉ๋ฒ์ ์๊ฐํด์ฃผ์
จ๋ค.<br>๋ฐ๋ก batํ์ผ๋ก ์์
์ค์ผ์ฅด๋ฌ๋ฅผ ๋๋ฆฌ๋ ๊ฒ์ด๋ค.<br>์ ๋ ์นด!<br>์ฐ๋ฆฌ ํ์ฌ ํ๋ก์ ํธ๋ ์๋์ฐ ์๋ฒ์ ์๋น์ค๋ก ๋ฑ๋ก๋์ด ์์ผ๋ฏ๋ก ์์
์ค์ผ์ฅด๋ฌ๋ฅผ ํตํด์ ํน์ ์๊ฐ์ ์๋ฒ๋ฅผ ์ฌ์์ํ ์ ์๋ค. </p><p><br><br><br></p><h1 id="Batchํ์ผ-์์ฑ"><a href="#Batchํ์ผ-์์ฑ" class="headerlink" title="Batchํ์ผ ์์ฑ"></a>Batchํ์ผ ์์ฑ</h1><p><code>tomcat_8080_restart.bat</code> ํ์ผ์ ์์ฑ ํ ์๋ ์ฝ๋๋ฅผ ์
๋ ฅํ๋ค.<br>๋ฏธ๋ฆฌ ์์์ผํ๋ ๊ฑด ์ฌ์์ํ๊ณ ์ถ์ ์๋น์ค์ด๋ฆ์ด๋ค.<br>์๋น์ค ์ด๋ฆ์ [์์คํ
-์๋น์ค]์์ ํน์ ์๋น์ค๋ฅผ ๋๋ธํด๋ฆญํ๋ฉด ํ์
์ ์๋น์ค ์ด๋ฆ์ด ํ์๋๋ค. ๊ทธ๊ฑธ ๊ธฐ์
ํ๋ฉด ๋๋ค. ์ฌ๊ธฐ์๋ ์๋น์ค์ด๋ฆ์ ์์๋ก <code>testProject</code>๋ฅผ ์ฌ์ฉํ ๊ฒ์ด๋ค.</p><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line">:: ๋ฐฐ์นํ์ผ์ ๋ช
๋ น์ด ์คํ ๋ด์ฉ์ ํ๋ฉด์ ํ์ํ์ง ์๋๋ก ์ค์ </span><br><span class="line"></span><br><span class="line"><span class="built_in">setlocal</span></span><br><span class="line">:: ํ๊ฒฝ ๋ณ์๋ฅผ ํ์ฌ ์คํฌ๋ฆฝํธ ๋ฒ์๋ก ์ ํ</span><br><span class="line"></span><br><span class="line">:: ์ฌ์์ํ๊ณ ์ถ์ ์๋น์ค๋ช
(testProject) ์๋น์ค๋ฅผ ์ค์งํ๊ณ ๋ก๊ทธ ํ์ผ์ ์ถ๋ ฅ ์ ์ฅ</span><br><span class="line"><span class="built_in">net</span> stop testProject > tomcat8080_stop_log.txt</span><br><span class="line"></span><br><span class="line">:: ๋ก๊ทธ ํ์ผ์์ ์ฒซ ๋ฒ์งธ ์ค์ ์ฝ์ด์ ๋ณ์ test์ ์ ์ฅ</span><br><span class="line"><span class="built_in">set</span> /p isStop=<tomcat8080_stop_log.txt</span><br><span class="line">:: ์ฝ์ด์จ ๋ด์ฉ์ ์ถ๋ ฅ</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%isStop%</span></span><br><span class="line"></span><br><span class="line">:: ๋ณ์ isStop์ ๊ฐ์ด ๋น์ด ์๋์ง ํ์ธ</span><br><span class="line"><span class="keyword">IF</span> "<span class="variable">%isStop%</span>" <span class="keyword">equ</span> "" (</span><br><span class="line"> <span class="built_in">echo</span> NULL :: isStop๊ฐ ๋น์ด ์๋ค๋ฉด NULL ์ถ๋ ฅ</span><br><span class="line">) <span class="keyword">else</span> (</span><br><span class="line"> <span class="built_in">echo</span> <span class="keyword">Not</span> NULL :: isStop๊ฐ ๋น์ด ์์ง ์๋ค๋ฉด <span class="keyword">Not</span> NULL ์ถ๋ ฅ</span><br><span class="line">)</span><br><span class="line"></span><br><span class="line">:: ๋ก๊ทธ ํ์ผ ์ญ์ </span><br><span class="line"><span class="built_in">del</span> tomcat8080_stop_log.txt</span><br><span class="line"></span><br><span class="line">:: ํ๋ฉด์ ์ง์ฐ๊ธฐ</span><br><span class="line"><span class="built_in">cls</span></span><br><span class="line"></span><br><span class="line">:<span class="built_in">Start</span></span><br><span class="line">:: ์คํฌ๋ฆฝํธ์ ์ฌ์์ ์์น ์ค์ </span><br><span class="line"></span><br><span class="line">timeout /t <span class="number">5</span></span><br><span class="line">:: <span class="number">5</span>์ด ๋์ ๋๊ธฐ (์๋น์ค ์ฌ์์ ์๊ฐ ํ๋ณด)</span><br><span class="line"></span><br><span class="line">:: testProject ์๋น์ค๋ฅผ ์์ํ๊ณ ๋ก๊ทธ ํ์ผ์ ์ถ๋ ฅ ์ ์ฅ</span><br><span class="line"><span class="built_in">net</span> <span class="built_in">start</span> testProject > <span class="number">8080</span>_start_log.txt</span><br><span class="line"></span><br><span class="line">:: ๋ก๊ทธ ํ์ผ์์ ์ฒซ ๋ฒ์งธ ์ค์ ์ฝ์ด์ ๋ณ์ isStart์ ์ ์ฅ</span><br><span class="line"><span class="built_in">set</span> /p isStart=<<span class="number">8080</span>_start_log.txt</span><br><span class="line">:: ์ฝ์ด์จ ๋ด์ฉ์ ์ถ๋ ฅ</span><br><span class="line"><span class="built_in">echo</span> <span class="variable">%isStart%</span></span><br><span class="line"></span><br><span class="line">:: ์๋น์ค ์์ ๊ฒฐ๊ณผ๊ฐ ํน์ ๋ฉ์์ง์ ์ผ์นํ๋์ง ํ์ธ</span><br><span class="line"><span class="keyword">IF</span> "<span class="variable">%isStart%</span>" <span class="keyword">equ</span> "์๋น์ค๋ฅผ ์์ํ๊ฑฐ๋ ๋ฉ์ถ๊ณ ์์ต๋๋ค. ๋์ค์ ๋ค์ ํ์ญ์์ค." (</span><br><span class="line"> <span class="built_in">del</span> <span class="number">8080</span>_start_log.txt</span><br><span class="line"> :: ๋ฌธ์ ๋ฐ์ ์ ๋ก๊ทธ ํ์ผ ์ญ์ </span><br><span class="line"> <span class="keyword">goto</span> <span class="built_in">Start</span></span><br><span class="line"> :: ๋ฌธ์ ํด๊ฒฐ์ ์ํด ์ฌ์๋</span><br><span class="line">)</span><br><span class="line"></span><br><span class="line">:: ์๋น์ค๊ฐ ์ ์์ ์ผ๋ก ์์๋์๋ค๋ฉด ๋ก๊ทธ ํ์ผ ์ญ์ </span><br><span class="line"><span class="built_in">del</span> <span class="number">8080</span>_start_log.txt</span><br></pre></td></tr></table></figure><p><br><br><br></p><h2 id="1-log-ํ
์คํธํ์ผ์-์ ์ฅํ๋-์ด์ "><a href="#1-log-ํ
์คํธํ์ผ์-์ ์ฅํ๋-์ด์ " class="headerlink" title="1 log ํ
์คํธํ์ผ์ ์ ์ฅํ๋ ์ด์ ?"></a>1 log ํ
์คํธํ์ผ์ ์ ์ฅํ๋ ์ด์ ?</h2><p>์์์ ๋ ๊ฐ์ tomcat8080_stop_log.txtํ์ผ๊ณผ 8080_start_log.txtํ์ผ์ ์์ฑํ๊ณ ์ญ์ ํ๋ค.<br>์ด๋ ๊ฒ log ํ
์คํธํ์ผ์ ์ ์ฅํ๋ ์ด์ ๋ณ์์ ํ ๋นํ๊ธฐ ์ํด์์ด๋ค.<br>๋ณ์์ ํ ๋นํ ๋ค ์๋น์ค ์ค์ง๊ฐ ์ฑ๊ณตํ๋์ง ๊ทธ ์ฑ๊ณต์ฌ๋ถ๋ฅผ ํ์ธํ๋ค.<br>batch ์๋์ฌ์คํ์ผ๋ก ๊ตฌ๊ธ์ ๊ฒ์ํด๋ณด๋ฉด stopํ๊ณ ๋ฐ๋ก startํ๋ ์คํฌ๋ฆฝํธ์ฝ๋๊ฐ ๋ง์๋ฐ ๊ทธ๋ ๊ฒ ํ๋ฉด stop์ ์คํจํ์๊ฒฝ์ฐ ์ฌ์์๋์ง์์ ์๋ฒ ๋ฐ์์ด ์๋ ์ ์๋ค๊ณ ํ์ฅ๋์ด ๋ง์ํด์ฃผ์
จ๋ค. (์ฒ์ฌ ํ์๋ ๊ฐ์ฌํฉ๋๋ค!)</p><p><br><br><br></p><h2 id="2-goto-๊ฐ-๋ฐ๋ณต๋ฌธ์-์ญํ "><a href="#2-goto-๊ฐ-๋ฐ๋ณต๋ฌธ์-์ญํ " class="headerlink" title="2 goto ๊ฐ ๋ฐ๋ณต๋ฌธ์ ์ญํ ?"></a>2 goto ๊ฐ ๋ฐ๋ณต๋ฌธ์ ์ญํ ?</h2><p>goto๋ ์ฝ๋์ ํน์ ์์น๋ก ์ด๋ํ๋ ๋ช
๋ น์ผ๋ก, ๋ฐ๋ณต์ ๊ตฌํํ ์ ์๋ ๋๊ตฌ๋ก ์ฌ์ฉ๋๊ธฐ๋ ํ๋ ๋ณธ์ง์ ์ผ๋ก ๋ฐ๋ณต ๋ช
๋ น์ด๋ ์๋๋ค.<br>goto๋ฅผ ๋ฐ๋ณต์ฒ๋ผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ๋ ์ฝ๋ ํ๋ฆ์ ํน์ ์์น๋ก ๊ณ์ ์ด๋์ํค๋ ๋ฐฉ์์ผ๋ก ๋ฐ๋ณต์ ํ๋ด ๋ด๋ ๊ฒ์ด๋ค. </p><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">:<span class="built_in">Start</span></span><br><span class="line">timeout /t <span class="number">5</span></span><br><span class="line">:: ... ์์
์ํ ...</span><br><span class="line"><span class="keyword">IF</span> ์กฐ๊ฑด (</span><br><span class="line"> <span class="keyword">goto</span> <span class="built_in">Start</span></span><br><span class="line">)</span><br></pre></td></tr></table></figure><p>์์ ์คํฌ๋ฆฝํธ์์ ์กฐ๊ฑด์ด ์ฐธ์ด๋ฉด goto Start ๋ช
๋ น์ผ๋ก ๋ค์ :Start ๋ ์ด๋ธ๋ก ์ด๋ํ์ฌ ์ฝ๋๋ฅผ ๋ฐ๋ณต ์คํํ๋ค.</p><p><br><br><br></p><h2 id="3-if-์กฐ๊ฑด์-์๋ฏธ๋"><a href="#3-if-์กฐ๊ฑด์-์๋ฏธ๋" class="headerlink" title="3. if ์กฐ๊ฑด์ ์๋ฏธ๋?"></a>3. if ์กฐ๊ฑด์ ์๋ฏธ๋?</h2><p>โ์๋น์ค๋ฅผ ์์ํ๊ฑฐ๋ ๋ฉ์ถ๊ณ ์์ต๋๋ค. ๋์ค์ ๋ค์ ํ์ญ์์ค.โ ๋ฉ์์ง๋ Windows์ ์๋น์ค ๊ด๋ฆฌ ๋ช
๋ น(net start ๋๋ net stop)์ ์คํํ ๋ ์๋น์ค๊ฐ ์ด๋ฏธ ์ค์ง ์ค์ด๊ฑฐ๋ ์์ ์ค์ธ ์ํ์์ ๋ฐ์ํ๋ ์ผ๋ฐ์ ์ธ ์์คํ
์๋ต์ด๋ค.<br>๋ง์ฝ ์๋ฒ๊ฐ ํ๊ธ์ด ์๋ ์๋ฌธ์ด๋ผ๋ฉด ์๋ ์๋ฌธ์๋์ฐ ๋์๋ฉ์์ง๋ฅผ, ์ผ๋ณธ์๋์ฐ๋ฉด ์ผ๋ณธ์๋์ฐ ๋์๋ฉ์์ง๋ฅผ ๋ฃ์ด์ผํ๋ค.</p><ul><li>ํ๊ธ Windows์์์ ๋ฉ์์ง: โ์๋น์ค๋ฅผ ์์ํ๊ฑฐ๋ ๋ฉ์ถ๊ณ ์์ต๋๋ค. ๋์ค์ ๋ค์ ํ์ญ์์ค.โ</li><li>์๋ฌธ Windows์์์ ๋์ ๋ฉ์์ง: โThe service is starting or stopping. Please try again later.โ</li><li>์ผ๋ณธ Windows์์์ ๋์ ๋ฉ์์ง: โใตใผใในใฏ้ๅงใพใใฏๅๆญขใใฆใใพใใๅพใงใใไธๅบฆๅฎ่กใใฆใใ ใใใโ</li></ul><p><br><br><br></p><h1 id="์๋์ฐ-์์
์ค์ผ์ฅด๋ฌ-๋ฑ๋ก"><a href="#์๋์ฐ-์์
์ค์ผ์ฅด๋ฌ-๋ฑ๋ก" class="headerlink" title="์๋์ฐ ์์
์ค์ผ์ฅด๋ฌ ๋ฑ๋ก"></a>์๋์ฐ ์์
์ค์ผ์ฅด๋ฌ ๋ฑ๋ก</h1><p>์์ ์ ๋๋ณด๊ธฐ์ <code>์์
์ค์ผ์ค๋ฌ</code>๋ฅผ ๊ฒ์ํ๋ค.<br><code>์ ์์
๋ง๋ค๊ธฐ</code>๋ฅผ ๋๋ฅด๊ณ ์ํ๋ ํธ๋ฆฌ๊ฑฐ๋ฅผ ์ค์ ํ๋ค.<br>ํธ๋ฆฌ๊ฑฐ๋ ํฌ๋ก ์ ์ฌ์ฉ์์ด GUI๋ก ๊ฐ๋จํ ์ค์ ํ ์ ์๋ค.<br>ํด๋น ๋ด์ฉ์ ๋๋ณด๋ค ์๋ ๋ธ๋ก๊ทธ๋ฅผ ์ฐธ๊ณ ํ๋ฉด ์ด๋ฏธ์ง์ ํจ๊ป ์์ธํ ์ค๋ช
์ ๋ณผ์์๋ค.</p><ul><li>์ฐธ๊ณ ๋ธ๋ก๊ทธ: <a href="https://minsuk-sung.tistory.com/11">์ฑ๋ฏผ์๋์ Windows 10์์ ์์
์ค์ผ์ค๋ฌ ์ฌ์ฉํ์ฌ ๋ฐฐ์นํ์ผ ๋ฑ๋ก</a></li></ul><p><br><br><br></p><h1 id="๋-์ด๋ค-์์
๋ค์-์๋ํ-ํ -์-์์๊น"><a href="#๋-์ด๋ค-์์
๋ค์-์๋ํ-ํ -์-์์๊น" class="headerlink" title="๋ ์ด๋ค ์์
๋ค์ ์๋ํ ํ ์ ์์๊น?"></a>๋ ์ด๋ค ์์
๋ค์ ์๋ํ ํ ์ ์์๊น?</h1><p>์๋ฒ์ฌ์์๋ฟ๋ง ์๋๋ผ ๊ฒฉ์ฃผ๋ก ๋ก๊ทธํ์ผ ์ง์ฐ๊ธฐ ๋ฑ์ ํ์ฉํ ์ ์๋ค.</p><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">forfiles /P "C:\Program Files\Apache Software Foundation\apache-tomcat-<span class="number">8</span>.<span class="number">5</span>.<span class="number">100</span>\logs" /M *.* /D -<span class="number">14</span> /C "<span class="built_in">cmd</span> /c <span class="built_in">del</span> @file"</span><br></pre></td></tr></table></figure><p>์ ์คํฌ๋ฆฝํธ์ ์คํ ํ๋ฆ์ ๋ณด์.</p><ol><li>C:\Program Files\Apache Software Foundation\apache-tomcat-8.5.100\logs ๊ฒฝ๋ก์์ ๋ก๊ทธ ํ์ผ ๊ฒ์.</li><li>ํ์ผ ์ด๋ฆ๊ณผ ์์ ๋ ์ง๋ฅผ ํ์ธํ์ฌ 14์ผ ์ด์ ์ ์์ ๋ ํ์ผ์ ์ฐพ์.</li><li>์กฐ๊ฑด์ ๋ง๋ ํ์ผ์ ๋ํด del ๋ช
๋ น์ ์คํํ์ฌ ํ์ผ์ ์ญ์ .</li></ol><p><br><br><br></p><h2 id="์์ธํ-์ค๋ช
"><a href="#์์ธํ-์ค๋ช
" class="headerlink" title="์์ธํ ์ค๋ช
"></a>์์ธํ ์ค๋ช
</h2><ol><li><code>/P ๊ฒฝ๋ก</code>: ์์
ํ ํ์ผ์ด ์์นํ ๊ธฐ๋ณธ ๊ฒฝ๋ก๋ฅผ ์ง์ ํ๋ค. ์ด ๊ฒฝ์ฐ, Tomcat ์๋ฒ์ ๋ก๊ทธ ํ์ผ ๋๋ ํฐ๋ฆฌ์ด๋ค.</li><li><code>/M *.*</code>: ๊ฒฝ๋ก ๋ด์ ํ์ผ ์ด๋ฆ ํจํด์ ์ง์ ํ๋ค. ์ฌ๊ธฐ์๋ <em>.</em>๋ก ๋ชจ๋ ํ์ผ(.* ํ์ฅ์ ํฌํจ)์ ๋์์ด๋ค.</li><li><code>/D -14</code>: ํ์ผ์ ์์ ๋ ์ง ์กฐ๊ฑด์ ์ง์ ํ๋ค. <code>-14</code>๋ 14์ผ ์ด์ ์ ์์ ๋ ํ์ผ์ ๋์์ผ๋ก ํ๋ค๋ ๋ป! ์๋ฅผ ๋ค์ด, ์ค๋์ด 2024๋
12์ 9์ผ์ด๋ผ๋ฉด, 2024๋
11์ 25์ผ ์ด์ ์ ์์ ๋ ํ์ผ๋ค์ด ๋์์ด ๋๋ค.</li><li><code>/C "cmd /c del @file"</code>: ๊ฐ ๋์ ํ์ผ์ ๋ํด ์คํํ ๋ช
๋ น์ ์ง์ ํ๋ค. <code>cmd /c</code>๋ ๋ช
๋ น ํ๋กฌํํธ์์ ๋ช
๋ น์ ์คํํ ํ ์ข
๋ฃํ๋ผ๋ ๋ป! <code>del @file</code>์ ๋์ ํ์ผ์ ์ญ์ ํ๋ค๋ ์๋ฏธ์ด๋ค.</li></ol><p><br><br><br></p><h2 id="์ฃผ์์ฌํญ"><a href="#์ฃผ์์ฌํญ" class="headerlink" title="์ฃผ์์ฌํญ"></a>์ฃผ์์ฌํญ</h2><p>์ญ์ ๋ ํ์ผ์ ๋ณต๊ตฌ๊ฐ ์ด๋ ค์ฐ๋ฏ๋ก ๋ฐฑ์
์ ํ์๋ค!<br>๋ง์ฝ ์คํ์ ์ญ์ ํ ํ์ผ๋ค์ ํ์ธํ๋ ค๋ฉด <code>cmd /c echo @file</code> ๋ช
๋ น์ผ๋ก ํ
์คํธํ ์์๋ค.</p><figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">forfiles /P "C:\Program Files\Apache Software Foundation\apache-tomcat-<span class="number">8</span>.<span class="number">5</span>.<span class="number">100</span>\logs" /M *.* /D -<span class="number">14</span> /C "<span class="built_in">cmd</span> /c <span class="built_in">echo</span> @file"</span><br></pre></td></tr></table></figure><p><br><br><br></p><h1 id="์ฐธ๊ณ "><a href="#์ฐธ๊ณ " class="headerlink" title="์ฐธ๊ณ "></a>์ฐธ๊ณ </h1><ul><li>ํ์ฅ๋์ง์</li><li>๊ตฌ๊ธ๋ง</li></ul>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/Operating-Systeming/">Operating Systeming</category>
<category domain="https://sowon-dev.github.io/tags/Tomcat/">Tomcat</category>
<comments>https://sowon-dev.github.io/2024/12/08/241209batch-service-restart/#disqus_thread</comments>
</item>
<item>
<title>[๋ธ๋ก๊ทธ]ํฅ์ํ
๋ง์์ ๋๊ธ๊ธฐ๋ฅ facebook์์ utterances๋ก ๋ณ๊ฒฝํ๊ธฐ</title>
<link>https://sowon-dev.github.io/2024/11/28/241129utterances/</link>
<guid>https://sowon-dev.github.io/2024/11/28/241129utterances/</guid>
<pubDate>Thu, 28 Nov 2024 23:23:25 GMT</pubDate>
<description><p>ํฅ์๋ธ๋ก๊ทธ์์ ๊ธฐ์กด ์ ๊ณตํ๋ ํ์ด์ค๋ถ ๋๊ธ๊ธฐ๋ฅ์ ์ฌ์ฉํ๊ณ ์์๋๋ฐ ๋์ด์ ํ์ด์ค๋ถ์ ์ฌ์ฉํ์ง์์ ์ญ์ ํ๊ณ ์ถ์๋ค.<br>๊ทธ๋ฌ๋ค ์ฐ์ฐํ ์ ํ์ฌ ํ์ฅ๋ ๊ฐ๋ฐ๋ธ๋ก๊ทธ์ ๊นํ์์ด๋๋ก ๋ก๊ทธ์ธํ์ฌ ์ธ ์ ์๋ ๋๊ธ๊ธฐ๋ฅ์ ๋ณด๊ณ ์ ๋ ์นด๋ฅผ ์ธ์ณค๋ค.</p></description>
<content:encoded><![CDATA[<p>ํฅ์๋ธ๋ก๊ทธ์์ ๊ธฐ์กด ์ ๊ณตํ๋ ํ์ด์ค๋ถ ๋๊ธ๊ธฐ๋ฅ์ ์ฌ์ฉํ๊ณ ์์๋๋ฐ ๋์ด์ ํ์ด์ค๋ถ์ ์ฌ์ฉํ์ง์์ ์ญ์ ํ๊ณ ์ถ์๋ค.<br>๊ทธ๋ฌ๋ค ์ฐ์ฐํ ์ ํ์ฌ ํ์ฅ๋ ๊ฐ๋ฐ๋ธ๋ก๊ทธ์ ๊นํ์์ด๋๋ก ๋ก๊ทธ์ธํ์ฌ ์ธ ์ ์๋ ๋๊ธ๊ธฐ๋ฅ์ ๋ณด๊ณ ์ ๋ ์นด๋ฅผ ์ธ์ณค๋ค.</p><a id="more"></a><p>ํ์ฅ๋๊ป ์ฌ์ญค๋ณด๋ ์์ ๋ณด๊ธฐํธํ ๋งํฌ๋ฅผ ์ฃผ์
์ ์ฝ๊ฒ ์ ์ฉ๊ฐ๋ฅํ๋ค. (๊ฐ์ฌํฉ๋๋ค ํ์ฅ๋!)</p><h1 id="์ฐธ๊ณ ํ-๋ธ๋ก๊ทธ"><a href="#์ฐธ๊ณ ํ-๋ธ๋ก๊ทธ" class="headerlink" title="์ฐธ๊ณ ํ ๋ธ๋ก๊ทธ"></a>์ฐธ๊ณ ํ ๋ธ๋ก๊ทธ</h1><ul><li><a href="https://velog.io/@outstandingboy/Github-%EB%B8%94%EB%A1%9C%EA%B7%B8%EC%97%90-%EB%8C%93%EA%B8%80-%EA%B8%B0%EB%8A%A5-%EC%B6%94%EA%B0%80%ED%95%98%EA%B8%B0-ft.-Utterances">์์์คํ ๋ฉ๋ณด์ด๋์ ๋ธ๋ก๊ทธ์ ๋๊ธ ๊ธฐ๋ฅ ์ถ๊ฐํ๊ธฐ (ft. Utterances)</a></li><li><a href="https://baek.dev/post/4/">BAEKDEV๋์ utterances๋ฅผ ๋ธ๋ก๊ทธ ๋๊ธ๋ก ์ ์ฉํ๊ธฐ</a></li></ul><p>์ ๋ ํฌ์คํ
์์ ์น์ ํ๊ฒ ์ ์ค๋ช
๋์ด์์ด ๊ธ๋ฐฉ ์ ์ฉ๊ฐ๋ฅํ๋ค.<br>๋ค๋ฅธ ์ ์ด ์๋ค๋ฉด ํฅ์๋ธ๋ก๊ทธํ
๋ง๋ ๋ฆฌ์กํธ jsx๊ธฐ๋ฐ์ด๋ค.</p><p><br><br><br></p><h1 id="๋๊ธ๋ฃ๊ธฐ"><a href="#๋๊ธ๋ฃ๊ธฐ" class="headerlink" title="๋๊ธ๋ฃ๊ธฐ"></a>๋๊ธ๋ฃ๊ธฐ</h1><p>comment.jsx ํ์ผ์์ utterances๋ฅผ ์ถ๊ฐํด์ค์ผํ๋ค</p><ul><li>ํ์ผ์์น: layout/common/cpmment.jsx</li></ul><p>์๋๋ ๊ธฐ์กด ์ฝ๋๋ฅผ ์ฃผ์์ฒ๋ฆฌํ๊ณ utteranc์ฝ๋๋ฅผ ์ถ๊ฐํ ๋ชจ์ต์ด๋ค.</p><figure class="highlight jsx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">module</span>.exports = <span class="class"><span class="keyword">class</span> <span class="keyword">extends</span> <span class="title">Component</span> </span>{</span><br><span class="line"> render() {</span><br><span class="line"> <span class="keyword">const</span> { config, page, helper } = <span class="keyword">this</span>.props;</span><br><span class="line"> <span class="keyword">const</span> { __ } = helper;</span><br><span class="line"> <span class="keyword">const</span> { comment } = config;</span><br><span class="line"> <span class="keyword">if</span> (!comment || <span class="keyword">typeof</span> comment.type !== <span class="string">'string'</span>) {</span><br><span class="line"> <span class="keyword">return</span> <span class="literal">null</span>;</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> <span class="keyword">return</span> <span class="xml"><span class="tag"><<span class="name">div</span> <span class="attr">class</span>=<span class="string">"card"</span>></span></span></span><br><span class="line"> <div class="card-content"></span><br><span class="line"> {/*</span><br><span class="line"><h3 class="title is-5">{__('article.comments')}</h3> </span><br><span class="line">{(() => {</span><br><span class="line"> try {</span><br><span class="line"> let Comment = view.require('comment/' + comment.type);</span><br><span class="line"> Comment = Comment.Cacheable ? Comment.Cacheable : Comment;</span><br><span class="line"> return <Comment config={config} page={page} helper={helper} comment={comment} />;</span><br><span class="line"> } catch (e) {</span><br><span class="line"> logger.w(`Icarus cannot load comment "${comment.type}"`);</span><br><span class="line"> return null;</span><br><span class="line"> }</span><br><span class="line"> })()}</span><br><span class="line">*/}</span><br><span class="line"><script src="https://utteranc.es/client.js"</span><br><span class="line">repo="๋ฆฌํฌ์งํ ๋ฆฌ ์ด๋ฆ"</span><br><span class="line">issue-term="pathname"</span><br><span class="line">theme="github-light"</span><br><span class="line">crossorigin="anonymous"</span><br><span class="line">async></span><br><span class="line"></script></span><br><span class="line"><span class="xml"> <span class="tag"></<span class="name">div</span>></span></span></span><br><span class="line"><span class="xml"> <span class="tag"></<span class="name">div</span>></span></span>;</span><br><span class="line"> }</span><br><span class="line">};</span><br></pre></td></tr></table></figure><p><br><br><br></p><h1 id="ํ์ด์ค๋ถ-์ฐ๊ฒฐํด์ ํ๊ธฐ"><a href="#ํ์ด์ค๋ถ-์ฐ๊ฒฐํด์ ํ๊ธฐ" class="headerlink" title="ํ์ด์ค๋ถ ์ฐ๊ฒฐํด์ ํ๊ธฐ"></a>ํ์ด์ค๋ถ ์ฐ๊ฒฐํด์ ํ๊ธฐ</h1><ul><li>ํ์ผ์์น: theme/hexo-theme-icarus/_config.yml</li></ul><p>์ ํ์ผ์์ </p><ol><li><code>fb_app_id</code>๋ฅผ ๊ฒ์ํ์ฌ ์ง์์ค๋ค.</li><li><code>comment:</code>๋ฅผ ๊ฒ์ํ์ฌ facebook์ ์ง์ฐ๋ฉด ์๋๋ค. ์ง์ฐ๊ฒ๋๋ฉด comment์์ฒด๊ฐ ๋นํ์ฑํ๋๋ค.</li></ol>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/Journal/">Journal</category>
<category domain="https://sowon-dev.github.io/tags/Hexo/">Hexo</category>
<comments>https://sowon-dev.github.io/2024/11/28/241129utterances/#disqus_thread</comments>
</item>
<item>
<title>[JAVA] Gmail SMTP ๋ค์ค ๋ฉ์ผ ์์ </title>
<link>https://sowon-dev.github.io/2024/11/28/241129javax-mail/</link>
<guid>https://sowon-dev.github.io/2024/11/28/241129javax-mail/</guid>
<pubDate>Thu, 28 Nov 2024 17:10:28 GMT</pubDate>
<description><p>java.util.Properties ์ javax.mail ํจํค์ง๋ฅผ ์ด์ฉํ์ฌ ์ฌ๋ฌ ์ฌ๋์๊ฒ ๋ฉ์ผ์ ๋ณด๋ด๋ณด์.</p></description>
<content:encoded><![CDATA[<p>java.util.Properties ์ javax.mail ํจํค์ง๋ฅผ ์ด์ฉํ์ฌ ์ฌ๋ฌ ์ฌ๋์๊ฒ ๋ฉ์ผ์ ๋ณด๋ด๋ณด์.</p><a id="more"></a><h1 id="๊ตฌ๊ธ-gmail-์ธ์ฆ์-์ํ-Class"><a href="#๊ตฌ๊ธ-gmail-์ธ์ฆ์-์ํ-Class" class="headerlink" title="๊ตฌ๊ธ gmail ์ธ์ฆ์ ์ํ Class"></a>๊ตฌ๊ธ gmail ์ธ์ฆ์ ์ํ Class</h1><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">MailAuthenticator</span> <span class="keyword">extends</span> <span class="title">Authenticator</span> </span>{</span><br><span class="line"> <span class="keyword">private</span> String id;</span><br><span class="line"> <span class="keyword">private</span> String pw;</span><br><span class="line"></span><br><span class="line"> <span class="function"><span class="keyword">public</span> <span class="title">MailAuthenticator</span><span class="params">(String id, String pw)</span></span>{</span><br><span class="line"> <span class="keyword">this</span>.id = id;</span><br><span class="line"> <span class="keyword">this</span>.pw = pw; </span><br><span class="line"> }</span><br><span class="line"> <span class="function"><span class="keyword">protected</span> PasswordAuthentication <span class="title">getPasswordAuthentication</span><span class="params">()</span> </span>{</span><br><span class="line"> <span class="keyword">return</span> <span class="keyword">new</span> PasswordAuthentication(id, pw);</span><br><span class="line"> }</span><br><span class="line">}</span><br></pre></td></tr></table></figure><p><br><br><br></p><h1 id="๊ตฌ๊ธ-gmail-๋ฐ์ก-์ฝ๋"><a href="#๊ตฌ๊ธ-gmail-๋ฐ์ก-์ฝ๋" class="headerlink" title="๊ตฌ๊ธ gmail ๋ฐ์ก ์ฝ๋"></a>๊ตฌ๊ธ gmail ๋ฐ์ก ์ฝ๋</h1><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">MailUtil</span> </span>{</span><br><span class="line"><span class="comment">// ๋ฐ์ ์์ ๋ณด</span></span><br><span class="line"><span class="keyword">private</span> String user = <span class="string">"test@gmail.com"</span>;</span><br><span class="line"><span class="keyword">private</span> String passwd = <span class="string">"test"</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">private</span> Session mailSession;</span><br><span class="line"><span class="keyword">private</span> Properties props = <span class="keyword">new</span> Properties();</span><br><span class="line">props.put(<span class="string">"mail.smtp.host"</span>, <span class="string">"smtp.gmail.com"</span>); <span class="comment">// smtp ์๋ฒ ์ฃผ์</span></span><br><span class="line">props.put(<span class="string">"mail.smtp.auth"</span>, <span class="string">"true"</span>); <span class="comment">// ์๋ฐ ๋ฉ์ผ API๊ฐ ์ฌ์ฉ์ ์ด๋ฆ๊ณผ ๋น๋ฐ๋ฒํธ๋ฅผ ์ ๊ณตํ์ฌ SMTP ์๋ฒ์ ์ธ์ฆ์ ์๋ํ๊ฒ ๋ค๋ ์๋ฏธ(gmail์ ๋ฌด์กฐ๊ฑด true ๊ณ ์ )</span></span><br><span class="line">props.setProperty(<span class="string">"mail.smtp.starttls.enable"</span>, <span class="string">"true"</span>); <span class="comment">// TLS๋ผ๋ ๋ณด์์ธ์ฆ์ ํ์ฑํ(SSL)(gmail์ ๋ฌด์กฐ๊ฑด true ๊ณ ์ )</span></span><br><span class="line">props.setProperty(<span class="string">"mail.smtp.port"</span>, <span class="string">"587"</span>); <span class="comment">// gmailํฌํธ587, ๋ค์ด๋ฒ ๋ฉ์ผํฌํธ465</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">boolean</span> <span class="title">sendMail</span><span class="params">(List<InternetAddress> to, String subject, StringBuffer content)</span> </span>{</span><br><span class="line"><span class="keyword">if</span>(to == <span class="keyword">null</span> || to.size() == <span class="number">0</span>) {</span><br><span class="line"><span class="keyword">return</span> <span class="keyword">false</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">//๊ตฌ๊ธ ๊ณ์ ์ธ์ฆ</span></span><br><span class="line">Authenticator authenticator = <span class="keyword">new</span> MailAuthenticator(user, passwd);</span><br><span class="line"></span><br><span class="line"><span class="comment">//์ธ์
</span></span><br><span class="line">mailSession = Session.getDefaultInstance(props, authenticator);</span><br><span class="line">MimeMessage msg = <span class="keyword">new</span> MimeMessage(mailSession);</span><br><span class="line"></span><br><span class="line"><span class="comment">//๋ณด๋ด๋์ฌ๋</span></span><br><span class="line">InternetAddress from = <span class="keyword">new</span> InternetAddress();</span><br><span class="line">String fromName = <span class="string">"๋ฐ์ ์ ๋๋ค์"</span>;</span><br><span class="line">from = <span class="keyword">new</span> InternetAddress(<span class="keyword">new</span> String(fromName.getBytes(charSet), <span class="string">"8859_1"</span>) + <span class="string">"<๋ฐ์ ์ ๊ตฌ๊ธ ์ด๋ฉ์ผ@gmail.com>"</span>);</span><br><span class="line">msg.setFrom(from);</span><br><span class="line"></span><br><span class="line"><span class="comment">//๋ฐ๋์ฌ๋(์ฌ๋ฌ๋ช
)</span></span><br><span class="line">InternetAddress[] address = <span class="keyword">new</span> InternetAddress[to.size()];</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i < to.size(); i++) {</span><br><span class="line">address[i] = to.get(i);</span><br><span class="line">}</span><br><span class="line">msg.setRecipients(Message.RecipientType.TO, address);</span><br><span class="line"></span><br><span class="line"><span class="comment">//์ ๋ชฉ</span></span><br><span class="line">msg.setSubject(subject, <span class="string">"UTF-8"</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">//๋ด์ฉ</span></span><br><span class="line">msg.setContent(content.toString(), <span class="string">"text/html; charset=UTF-8"</span>); <span class="comment">// HTML ํ์</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//๋ณด๋ด๋๋ ์ง</span></span><br><span class="line">msg.setSentDate(<span class="keyword">new</span> java.util.Date());</span><br><span class="line"></span><br><span class="line"><span class="comment">//์ ์ก</span></span><br><span class="line">Transport.send(msg);</span><br><span class="line"><span class="keyword">return</span> <span class="keyword">true</span>;</span><br><span class="line">}</span><br><span class="line">}</span><br></pre></td></tr></table></figure>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/JAVA/">JAVA</category>
<comments>https://sowon-dev.github.io/2024/11/28/241129javax-mail/#disqus_thread</comments>
</item>
<item>
<title>[JAVA] java.util.properties ๊ฐ๋
๊ณผ ์์, propertiesํ์ผ๊ณผ ์ฐจ์ด์ </title>
<link>https://sowon-dev.github.io/2024/11/28/241129java-util-properties/</link>
<guid>https://sowon-dev.github.io/2024/11/28/241129java-util-properties/</guid>
<pubDate>Thu, 28 Nov 2024 17:05:27 GMT</pubDate>
<description><p>๋ ๊ฑฐ์๋ฅผ ๋ถ์ํ๋ ์ค ์ด๋ฉ์ผ์ ์ก ์๋น์ค์์ java.util.Properties ๊ฐ์ฒด๋ฅผ ๋ฐ๊ฒฌํ๋ค.<br>์ฒ์๋ณด๋ ๊ฐ์ฒด๋ผ์ ๋ฌด์์ธ์ง ํ์ธํด๋ณด์๋ค.</p></description>
<content:encoded><![CDATA[<p>๋ ๊ฑฐ์๋ฅผ ๋ถ์ํ๋ ์ค ์ด๋ฉ์ผ์ ์ก ์๋น์ค์์ java.util.Properties ๊ฐ์ฒด๋ฅผ ๋ฐ๊ฒฌํ๋ค.<br>์ฒ์๋ณด๋ ๊ฐ์ฒด๋ผ์ ๋ฌด์์ธ์ง ํ์ธํด๋ณด์๋ค.</p><a id="more"></a><h1 id="java-util-Properties"><a href="#java-util-Properties" class="headerlink" title="java.util.Properties"></a>java.util.Properties</h1><ul><li><a href="https://docs.oracle.com/javase/7/docs/api/java/util/Properties.html">์ค๋ผํด java.util.Properties</a><br>์ค๋ผํด๋ฌธ์์ ๋ฐ๋ฅด๋ฉด Properties๊ฐ์ฒด๋ (String, String)์ ๊ฐ์ง ๊ฐ์ฒด๋ก Hashtable์์ ์์ํ๋ค.<br>๋ฐ๋ผ์ Hashtable์ ๋ฉ์๋์ธ put(), putAll()์ ์ฌ์ฉํ ์ ์์ผ๋ setProperty() ์ฌ์ฉ์ ๊ถ์ฅํ๋ค.<br>๊ทธ ์ด์ ๋ put(), putAll()์๋ String์ด์ธ์ ๊ฐ์ด ๋ค์ด๊ฐ ์ ์๊ธฐ ๋๋ฌธ์ ์๋ฌ ๋ฐ์ํ๋ฅ ์ด ๋๋ค.</li></ul><p><br><br><br></p><h1 id="์ฅ๋จ์ "><a href="#์ฅ๋จ์ " class="headerlink" title="์ฅ๋จ์ "></a>์ฅ๋จ์ </h1><ul><li><p>์ฅ์ </p><table><thead><tr><th><strong>์ฅ์ </strong></th><th><strong>์ค๋ช
</strong></th></tr></thead><tbody><tr><td><strong>๊ฐ๋จํ ํค-๊ฐ ๊ด๋ฆฌ</strong></td><td>๋ฌธ์์ด ๊ธฐ๋ฐ์ ํค-๊ฐ ์์ ์ฝ๊ฒ ๊ด๋ฆฌํ ์ ์์ต๋๋ค.</td></tr><tr><td><strong>ํ์ผ ์
์ถ๋ ฅ ์ง์</strong></td><td><code>.properties</code> ํ์ผ์ ๊ฐํธํ๊ฒ ์ฝ๊ณ ์ธ ์ ์์ต๋๋ค.</td></tr><tr><td><strong>๊ธฐ๋ณธ๊ฐ ์ ๊ณต ๊ธฐ๋ฅ</strong></td><td>๋ค๋ฅธ <code>Properties</code> ๊ฐ์ฒด๋ฅผ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ค์ ํ ์ ์์ด ์ ์ฐํฉ๋๋ค.</td></tr><tr><td><strong>๊ตญ์ ํ (i18n) ์ง์</strong></td><td>๋ค๊ตญ์ด ์ง์์ ์ํ ๋ฆฌ์์ค ๋ฒ๋ค๊ณผ ํตํฉ์ด ์ฉ์ดํฉ๋๋ค.</td></tr><tr><td><strong>๋์ ์ค์ ๋ณ๊ฒฝ</strong></td><td>์คํ ์ค์๋ ์ค์ ๊ฐ์ ๋์ ์ผ๋ก ๋ณ๊ฒฝํ ์ ์์ต๋๋ค.</td></tr></tbody></table></li><li><p>๋จ์ </p><table><thead><tr><th><strong>๋จ์ </strong></th><th><strong>์ค๋ช
</strong></th></tr></thead><tbody><tr><td><strong>๋ฌธ์์ด ๊ธฐ๋ฐ ํ๊ณ</strong></td><td>๋ณต์กํ ๋ฐ์ดํฐ ๊ตฌ์กฐ๋ฅผ ์ ์ฅํ๊ธฐ ์ด๋ ต๊ณ ๋ฌธ์์ด๋ก๋ง ์ ์ฅ๋ฉ๋๋ค.</td></tr><tr><td><strong>๋ณด์ ์ทจ์ฝ์ฑ</strong></td><td>์ค์ ํ์ผ์ด ํ๋ฌธ์ผ๋ก ์ ์ฅ๋๋ฏ๋ก ๋ฏผ๊ฐํ ์ ๋ณด ๋
ธ์ถ ์ํ์ด ์์ต๋๋ค.</td></tr><tr><td><strong>๋ฐ์ดํฐ ํ ๋ณํ ํ์</strong></td><td>์ซ์, ๋ถ๋ฆฌ์ธ ๋ฑ ๋ค๋ฅธ ๋ฐ์ดํฐ ํ์
์ ๋ณํ ์ฝ๋๊ฐ ํ์ํฉ๋๋ค.</td></tr><tr><td><strong>์ค๋ ๋ ์์ ์ฑ ๋ถ์กฑ</strong></td><td>์ค๋ ๋ ์์ ํ์ง ์์ ์ฌ๋ฌ ์ค๋ ๋์์ ์ ๊ทผ ์ ๋๊ธฐํ๊ฐ ํ์ํฉ๋๋ค.</td></tr></tbody></table></li></ul><p><br><br><br></p><h1 id="์ฌ์ฉ์์"><a href="#์ฌ์ฉ์์" class="headerlink" title="์ฌ์ฉ์์"></a>์ฌ์ฉ์์</h1><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//์ ์ธ</span></span><br><span class="line"><span class="keyword">private</span> Properties props = <span class="keyword">new</span> Properties();</span><br><span class="line"></span><br><span class="line"><span class="comment">//์
๋ ฅ </span></span><br><span class="line">props.put(<span class="string">"mail.smtp.host"</span>, <span class="string">"smtp.gmail.com"</span>); <span class="comment">// smtp ์๋ฒ ์ฃผ์</span></span><br><span class="line">props.put(<span class="string">"mail.smtp.auth"</span>, <span class="string">"true"</span>); <span class="comment">// ์๋ฐ ๋ฉ์ผ API๊ฐ ์ฌ์ฉ์ ์ด๋ฆ๊ณผ ๋น๋ฐ๋ฒํธ๋ฅผ ์ ๊ณตํ์ฌ SMTP ์๋ฒ์ ์ธ์ฆ์ ์๋ํ๊ฒ ๋ค๋ ์๋ฏธ(gmail์ ๋ฌด์กฐ๊ฑด true ๊ณ ์ )</span></span><br><span class="line">props.setProperty(<span class="string">"mail.smtp.starttls.enable"</span>, <span class="string">"true"</span>); <span class="comment">// TLS๋ผ๋ ๋ณด์์ธ์ฆ์ ํ์ฑํ(SSL)(gmail์ ๋ฌด์กฐ๊ฑด true ๊ณ ์ )</span></span><br><span class="line">props.setProperty(<span class="string">"mail.smtp.port"</span>, <span class="string">"587"</span>); <span class="comment">// gmailํฌํธ587, ๋ค์ด๋ฒ ๋ฉ์ผํฌํธ465</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//์ถ๋ ฅ</span></span><br><span class="line">properties.getProperty(<span class="string">"mail.smtp.host"</span>);</span><br><span class="line">properties.getProperty(<span class="string">"mail.smtp.starttls.enable"</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">//์์ํ</span></span><br><span class="line">smtp.gmail.com</span><br><span class="line"><span class="keyword">true</span></span><br></pre></td></tr></table></figure><p><br><br><br></p><h1 id="๊ทธ๋์-์-๋ชฐ๋์๊น"><a href="#๊ทธ๋์-์-๋ชฐ๋์๊น" class="headerlink" title="๊ทธ๋์ ์ ๋ชฐ๋์๊น?"></a>๊ทธ๋์ ์ ๋ชฐ๋์๊น?</h1><p>์์ฑ๋ค ๊ด๋ฆฌ๋ฅผ <code>.properties</code>์์ ํ๊ธฐ๋๋ฌธ์ ๋ชฐ๋์๋ค!</p><p><br><br><br></p><h2 id="์ฌ์ฉ์์-1"><a href="#์ฌ์ฉ์์-1" class="headerlink" title="์ฌ์ฉ์์"></a>์ฌ์ฉ์์</h2><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">// ์คํ๋ง๋ถํธ์ธ ๊ฒฝ์ฐ application.properties์ ๋์ผํ๊ฒ ์ ์ธ</span><br><span class="line">mail.smtp.host=smtp.gmail.com # smtp ์๋ฒ ์ฃผ์</span><br><span class="line">mail.smtp.auth=true # ์๋ฐ ๋ฉ์ผ API๊ฐ ์ฌ์ฉ์ ์ด๋ฆ๊ณผ ๋น๋ฐ๋ฒํธ๋ฅผ ์ ๊ณตํ์ฌ SMTP ์๋ฒ์ ์ธ์ฆ์ ์๋ํ๊ฒ ๋ค๋ ์๋ฏธ</span><br><span class="line">mail.smtp.starttls.enable=true # TLS๋ผ๋ ๋ณด์ ์ธ์ฆ์ ํ์ฑํ (SSL)</span><br><span class="line">mail.smtp.port=587 # gmail ํฌํธ 587, ๋ค์ด๋ฒ ๋ฉ์ผ ํฌํธ 465</span><br><span class="line"></span><br><span class="line">// ์ฌ์ฉ</span><br><span class="line">@Value("\${mail.smtp.port:465}") //๋ง์ฝ properties์ ์ง์ ๋ ๊ฐ์ด ์์ ๊ฒฝ์ฐ 465</span><br></pre></td></tr></table></figure><p><br><br><br></p><h1 id="java-util-Properties-ํด๋์ค์-properties์ฃผ์-์ฐจ์ด์ "><a href="#java-util-Properties-ํด๋์ค์-properties์ฃผ์-์ฐจ์ด์ " class="headerlink" title="java.util.Properties ํด๋์ค์ .properties์ฃผ์ ์ฐจ์ด์ :"></a>java.util.Properties ํด๋์ค์ <code>.properties</code>์ฃผ์ ์ฐจ์ด์ :</h1><ol><li>ํ์ผ๊ณผ ์ฝ๋์ ์ญํ :<ul><li><code>.properties</code> ํ์ผ: ์ธ๋ถ ํ์ผ๋ก์ ์ ํ๋ฆฌ์ผ์ด์
์ ์ค์ ์ ๋ณด๋ฅผ ์ ์ฅํฉ๋๋ค.</li><li><code>java.util.Properties</code> ํด๋์ค: ์ด ํ์ผ์ ์ฝ๊ณ ์ฐ๊ธฐ ์ํ ์๋ฐ์ ๋ด๋ถ ๋ฉ๋ชจ๋ฆฌ ํํ์
๋๋ค.</li></ul></li><li>๋ฐ์ดํฐ ์ ๊ทผ:<ul><li>ํ์ผ: ์ฌ๋์ด ์ฝ๊ธฐ ์ฝ๊ณ , ์ธ๋ถ์์ ์ง์ ์์ ํ ์ ์์ต๋๋ค.</li><li>ํด๋์ค: ํ๋ก๊ทธ๋จ ๋ด์์ ๋์ ์ผ๋ก ํ๋กํผํฐ๋ฅผ ์ฝ๊ฑฐ๋ ์ค์ ํ ์ ์์ต๋๋ค.</li></ul></li><li>๋์ ๋ณ๊ฒฝ:<ul><li>ํ์ผ: ํ์ผ์ ์์ ํ๊ณ ์ ์ฅํด์ผ๋ง ๊ฐ์ด ๋ฐ๋๋๋ค.</li><li>ํด๋์ค: ๋ฐํ์์ setProperty() ๋ฉ์๋๋ก ๋ณ๊ฒฝ์ด ๊ฐ๋ฅํฉ๋๋ค.</li></ul></li><li>๋ก๋ ๋ฐ ์ ์ฅ:<ul><li><code>.properties</code> ํ์ผ์ ์ฃผ๋ก ์ ํ๋ฆฌ์ผ์ด์
์์ ์ ์ค์ ๊ฐ์ ๋ถ๋ฌ์ฌ ๋ ์ฌ์ฉ๋ฉ๋๋ค.</li><li>Properties ๊ฐ์ฒด๋ ๋ฉ๋ชจ๋ฆฌ ๋ด์์ ์ด ์ค์ ๊ฐ์ ๊ด๋ฆฌํ๋ฉฐ, ํ์ ์ ๋ค์ ํ์ผ์ ์ ์ฅํ ์๋ ์์ต๋๋ค.</li></ul></li></ol><p>์ด์ธ์๋ ์ฑ๊ธํคํจํด์ผ๋ java.util.Properties๋ฅผ ์ฌ์ฉํ๋ค๊ณ ํ๋ค.<br>ํ๋ก์ ํธ์ ์ ํฉํ ๋ฐฉ๋ฒ์ ์ ํํ๋ฉด ๋๋ค.</p>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/JAVA/">JAVA</category>
<comments>https://sowon-dev.github.io/2024/11/28/241129java-util-properties/#disqus_thread</comments>
</item>
<item>
<title>[์ค๋ผํด]GROUP BY์ฟผ๋ฆฌ๋ฅผ PIVOT์ฟผ๋ฆฌ๋ก ๋ฐ๊ฟ๋ณด์</title>
<link>https://sowon-dev.github.io/2024/10/22/241023oracle-query-pivot/</link>
<guid>https://sowon-dev.github.io/2024/10/22/241023oracle-query-pivot/</guid>
<pubDate>Tue, 22 Oct 2024 16:10:17 GMT</pubDate>
<description><p>GORUP BY๋ก ํด๊ฒฐํ๋ ค๊ณ ๋
ธ๋ ฅํ์ง๋ง ์ ๋์ง์์์ PIVOT ์ฟผ๋ฆฌ๋ฅผ ์ฒ์ ์ฌ์ฉํ๊ฒ ๋์๋ค.</p></description>
<content:encoded><![CDATA[<p>GORUP BY๋ก ํด๊ฒฐํ๋ ค๊ณ ๋
ธ๋ ฅํ์ง๋ง ์ ๋์ง์์์ PIVOT ์ฟผ๋ฆฌ๋ฅผ ์ฒ์ ์ฌ์ฉํ๊ฒ ๋์๋ค.</p><a id="more"></a><h1 id="PIVOT-VS-GROUP-BY"><a href="#PIVOT-VS-GROUP-BY" class="headerlink" title="PIVOT VS GROUP BY"></a>PIVOT VS GROUP BY</h1><table><thead><tr><th align="center"></th><th align="left">GROUP BY</th><th align="left">PIVOT</th></tr></thead><tbody><tr><td align="center">๋ชฉ์ </td><td align="left">ํน์ ์ด์ ๊ธฐ์ค์ผ๋ก ๊ทธ๋ฃนํํ์ฌ ๊ฐ ๊ทธ๋ฃน์ ๋ํด ์ง๊ณ(ํฉ๊ณ, ํ๊ท , ์ต๋๊ฐ ๋ฑ)๋ ๊ฒฐ๊ณผ๋ฅผ ๊ณ์ฐ</td><td align="left">๋ฐ์ดํฐ๋ฅผ ์ด๋ก ๋ณํํ์ฌ ์์ฝ๋ ๋ฐ์ดํฐ๋ฅผ ํ
์ด๋ธ ํํ๋ก ํํ</td></tr><tr><td align="center">๊ฒฐ๊ณผ</td><td align="left">๊ฐ ๊ทธ๋ฃน๋ณ๋ก ์ง๊ณ๋ ๊ฐ์ด ํ ๋จ์๋ก ์ถ๋ ฅ</td><td align="left">ํ ๋ฐ์ดํฐ๋ฅผ ์ด๋ก ๋ณํํ์ฌ ๊ฐ ์นดํ
๊ณ ๋ฆฌ(์: ๋ถ์, ์ ํ ์ข
๋ฅ ๋ฑ)์ ๋ํ ์์ฝ ์ ๋ณด๋ฅผ ํ๋์ ์ถ๋ ฅ</td></tr><tr><td align="center">์ฌ์ฉ ์ฉ๋</td><td align="left">์ด๋ก ๋ณํํ๋ ๊ฒ์ด ์๋๋ผ, ๊ทธ๋ฃน๋ณ๋ก ์ง๊ณํ ๋ฐ์ดํฐ๋ฅผ ํ์ผ๋ก ์ถ๋ ฅํ ๋ ์ฌ์ฉ</td><td align="left">ํน์ ์ปฌ๋ผ ๊ฐ์ ๊ธฐ์ค์ผ๋ก ๋ฐ์ดํฐ๋ฅผ ํ์ (pivot) ์์ผ ์ง๊ณํ ๊ฐ์ ์ฌ๋ฌ ์ด๋ก ํํํ ๋ ์ฌ์ฉ</td></tr></tbody></table><p><br><br><br></p><h1 id="๋ด-์ฝ๋-GROUP-BY-์ฌ์ฉ"><a href="#๋ด-์ฝ๋-GROUP-BY-์ฌ์ฉ" class="headerlink" title="๋ด ์ฝ๋: GROUP BY ์ฌ์ฉ"></a>๋ด ์ฝ๋: GROUP BY ์ฌ์ฉ</h1><p>์๊ตฌ์ฌํญ์ ํ์๋ณ๋ก ๊ณผ๋ชฉ์ฝ๋100,200,300์ ์ ์์ ์ธ ๊ณผ๋ชฉ์ ์ ์ํฉ๊ณ๋ฅผ ๋ณด๊ณ ์ถ์๋ค.<br>๊ทธ๋์ ๋จผ์ ๊ทธ๋ฃนํ์ ๋ ์ฌ๋ ธ๋ค.</p><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">SELECT</span> </span><br><span class="line">A.YR </span><br><span class="line">, A.USERNO </span><br><span class="line">, A.USERNM </span><br><span class="line">, <span class="keyword">SUBSTR</span>(A.IDENTITY_NO, <span class="number">1</span>, <span class="number">6</span>) <span class="keyword">AS</span> BRDT<span class="comment">/*์๋
์์ผ*/</span> </span><br><span class="line">, NVL(<span class="keyword">MAX</span>(<span class="keyword">CASE</span> <span class="keyword">WHEN</span> C.TEST_CD = <span class="string">'100'</span> <span class="keyword">THEN</span> C.SCR <span class="keyword">END</span>),<span class="number">0</span>) <span class="keyword">AS</span> SCORE1 <span class="comment">/* TEST_CD๊ฐ 100์ธ ์ ์ */</span></span><br><span class="line">, NVL(<span class="keyword">MAX</span>(<span class="keyword">CASE</span> <span class="keyword">WHEN</span> C.TEST_CD = <span class="string">'200'</span> <span class="keyword">THEN</span> C.SCR <span class="keyword">END</span>),<span class="number">0</span>) <span class="keyword">AS</span> SCORE2 <span class="comment">/* TEST_CD๊ฐ 200์ธ ์ ์ */</span></span><br><span class="line">, NVL(<span class="keyword">MAX</span>(<span class="keyword">CASE</span> <span class="keyword">WHEN</span> C.TEST_CD = <span class="string">'300'</span> <span class="keyword">THEN</span> C.SCR <span class="keyword">END</span>),<span class="number">0</span>) <span class="keyword">AS</span> SCORE3 <span class="comment">/* TEST_CD๊ฐ 300์ธ ์ ์ */</span></span><br><span class="line">, D.TOTAL_SCR <span class="comment">/*์ฐ์ถ์ ์*/</span></span><br><span class="line"><span class="keyword">FROM</span> EE_USER_INFO A </span><br><span class="line"><span class="keyword">JOIN</span> EE_TEST_SCORE C </span><br><span class="line"><span class="keyword">ON</span> A.YR = C.YR </span><br><span class="line"><span class="keyword">AND</span> A.USERNO = C.USERNO</span><br><span class="line"><span class="keyword">JOIN</span> EE_TEST_RESLUT D</span><br><span class="line"><span class="keyword">ON</span> A.YR = D.YR</span><br><span class="line"><span class="keyword">AND</span> A.USERNO = D.USERNO</span><br><span class="line"><span class="keyword">GROUP</span> <span class="keyword">BY</span> A.YR, A.USERNO, A.USERNM, <span class="keyword">SUBSTR</span>(A.IDENTITY_NO), <span class="number">1</span>, <span class="number">6</span>), D.TOTAL_SCR</span><br></pre></td></tr></table></figure><p>์ฌ๊ธฐ์ ๋ฌธ์ ๋ TEST_CD๊ฐ 100,200,300์ผ๋ก ๊ณ ์ ๋์ง ์์๋ค๋ ๊ฒ์ด๋ค.<br>TEST_CD๊ฐ ๊ณตํต์ฝ๋๋ก ์ด๋ฃจ์ด์ ธ์์ด์ ์ฐ๋์ ๋ฐ๋ผ ํน์ ์ฐ๋์๋ 400,500,600์ ์ธ ์๋ ์์๋ค.<br>์ฐ๋๋ณ ๊ณผ๋ชฉ์ฝ๋ 3๊ฐ๋ง ์ถ์ถํ๋ฉด ๋๋๋ฐโฆ ๋๊ฐํ ์ํฉ!<br>์ด๋ด๋๋ ์ด๋ป๊ฒ ํด์ผํ ๊น? </p><p>ํ์ฅ๋์ PIVOT์ ์ฌ์ฉํด๋ณด๋ผ๊ณ ์กฐ์ธํด์ฃผ์
จ๋ค.</p><p><br><br><br></p><h1 id="์ ๊น-GROUP-BY-์ ์-์ง๊ณํจ์๋ฅผ-์-๋ฃ์ด๋-๋๋์ง"><a href="#์ ๊น-GROUP-BY-์ ์-์ง๊ณํจ์๋ฅผ-์-๋ฃ์ด๋-๋๋์ง" class="headerlink" title="์ ๊น) GROUP BY ์ ์ ์ง๊ณํจ์๋ฅผ ์ ๋ฃ์ด๋ ๋๋์ง?"></a>์ ๊น) GROUP BY ์ ์ ์ง๊ณํจ์๋ฅผ ์ ๋ฃ์ด๋ ๋๋์ง?</h1><p><code>GROUP BY</code> ์ ์๋ ์ง๊ณ ํจ์์ ํฌํจ๋์ง ์์ ๋ชจ๋ ํ๋ ๋๋ ํํ์์ ํฌํจํด์ผํ๋ค.<br>CASE WHEN๊ณผ MAX ํจ์๋ ๊ทธ๋ฃนํ๋ ๋ฐ์ดํฐ์ ๋ํด ์ง๊ณ๋ฅผ ์ํํ๋ ๋ถ๋ถ์ด๋ฏ๋ก <code>GROUP BY</code> ์ ์ ํฌํจ๋์ง ์์๋ ๋๋ค.<br>์ง๊ณ๋์ง ์๋ ํ๋๋ค์ ๊ฐ ๊ทธ๋ฃน์ ๋ํด ๊ณ ์ ํ ๊ฐ์ ๊ฐ์ ธ์ผ ํ๋ฏ๋ก, ๊ทธ๋ฃนํ ์กฐ๊ฑด์ผ๋ก ์ถ๊ฐ๋์ด์ผ ํ๋ค. </p><p><br><br><br></p><h1 id="ํ์ฅ๋-์ฝ๋-PIVOT-์ฌ์ฉ"><a href="#ํ์ฅ๋-์ฝ๋-PIVOT-์ฌ์ฉ" class="headerlink" title="ํ์ฅ๋ ์ฝ๋ : PIVOT ์ฌ์ฉ"></a>ํ์ฅ๋ ์ฝ๋ : PIVOT ์ฌ์ฉ</h1><p>ํ์ฅ๋ ์์ ํด์ฃผ์ ์ฟผ๋ฆฌ๋ ์๋์ ๊ฐ๋ค.</p><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">SELECT</span> </span><br><span class="line"> A.YR,</span><br><span class="line"> A.USERNO,</span><br><span class="line"> A.USERNM,</span><br><span class="line"> <span class="keyword">SUBSTR</span>(A.IDENTITY_NO, <span class="number">1</span>, <span class="number">6</span>) <span class="keyword">AS</span> BRDT, <span class="comment">/* ์๋
์์ผ */</span></span><br><span class="line"> A.SCR1, </span><br><span class="line"> A.SCR2, </span><br><span class="line"> A.SCR3, </span><br><span class="line"> D.TOTAL_SCR <span class="comment">/*์ฐ์ถ์ ์*/</span></span><br><span class="line"><span class="keyword">FROM</span> (</span><br><span class="line"> <span class="keyword">SELECT</span> </span><br><span class="line"> A.YR,</span><br><span class="line"> A.USERNO,</span><br><span class="line"> TO_CHAR(RANK_1) <span class="keyword">AS</span> SCR1,</span><br><span class="line"> TO_CHAR(RANK_2) <span class="keyword">AS</span> SCR2, </span><br><span class="line"> TO_CHAR(RANK_3) <span class="keyword">AS</span> SCR3</span><br><span class="line"><span class="keyword">FROM</span> (</span><br><span class="line"><span class="keyword">SELECT</span> </span><br><span class="line"> A.YR</span><br><span class="line"> , A.USERNO </span><br><span class="line"> , A.SCR </span><br><span class="line"> , <span class="string">'RANK'</span> || <span class="keyword">RANK</span>() <span class="keyword">OVER</span> (<span class="keyword">PARTITION</span> <span class="keyword">BY</span> A.YR, A.USERNO <span class="keyword">ORDER</span> <span class="keyword">BY</span> A.TEST_CD) <span class="keyword">AS</span> RANK_CD</span><br><span class="line"> <span class="keyword">FROM</span> </span><br><span class="line"> EE_TEST_SCORE A</span><br><span class="line"> <span class="keyword">WHERE</span> </span><br><span class="line"> A.YR = <span class="comment">#{YR}</span></span><br><span class="line"> <span class="keyword">ORDER</span> <span class="keyword">BY</span> </span><br><span class="line"> A.USERNO</span><br><span class="line">)</span><br><span class="line"> <span class="keyword">PIVOT</span> (</span><br><span class="line"> <span class="keyword">SUM</span>(SCR) </span><br><span class="line"> <span class="keyword">FOR</span> RANK_CD <span class="keyword">IN</span> (</span><br><span class="line"> <span class="string">'RANK1'</span> <span class="keyword">AS</span> RANK_1,</span><br><span class="line"> <span class="string">'RANK2'</span> <span class="keyword">AS</span> RANK_2,</span><br><span class="line"> <span class="string">'RANK3'</span> <span class="keyword">AS</span> RANK_3</span><br><span class="line"> )</span><br><span class="line">)</span><br><span class="line">) A</span><br><span class="line"><span class="keyword">JOIN</span> EE_TEST_RESLUT D</span><br><span class="line"><span class="keyword">ON</span> A.YR = D.YR</span><br><span class="line"><span class="keyword">AND</span> A.USERNO = D.USERNO</span><br></pre></td></tr></table></figure><p>PIVOT์ ์ฌ์ฉํ์ฌ ๊ฐ ๊ณผ๋ชฉ ์ ์๋ฅผ ๊ฐ๋ก๋ก ๋ณํํ๊ณ , ์ต์ข
์ ์ผ๋ก ํฉ๊ณ ์ ์๋ ๋ค๋ฅธ ํ
์ด๋ธ(EE_TEST_RESLUT)์์ ๊ฐ์ ธ์ ์ถ๋ ฅํ๋ค.</p><p>์ฟผ๋ฆฌ๊ฒฐ๊ณผ ์์๋ ์๋์ ๊ฐ๋ค.</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">YRUSERNOUSERNMBRDTSCORE1SCORE2SCORE3TOTAL_SCR1</span><br><span class="line">2024101John900101908570245</span><br><span class="line">2024102Alice920202958060235</span><br><span class="line">2024103Bob880303887865231</span><br></pre></td></tr></table></figure><p>๋ ์ฟผ๋ฆฌ๋ ๋์ผํ ๋ฐ์ดํฐ๋ฅผ ์ถ๋ ฅํ์ง๋ง,<br>PIVOT ์ฟผ๋ฆฌ๋ ๋ฐ์ดํฐ ํผ๋ดํ
์ ์ฌ์ฉํด TEST_CD ๊ฐ์ ๋ฐ๋ผ ์๋์ผ๋ก ์ ์๋ฅผ ์ด๋ก ๋ณํํ๋ฏ๋ก ์ฝ๋๊ฐ ํจ์ฌ ๊ฐ๊ฒฐํ๊ณ ๋ช
ํํ๋ค.</p><p>์๋ ๊ฒ๋ง ๋ณด์ธ๋ค๊ณ โฆ<br>PIVOT๊ณผ๋ ์นํด์ง์.</p><p><br><br><br></p><h1 id="์ถ์ฒ"><a href="#์ถ์ฒ" class="headerlink" title="์ถ์ฒ"></a>์ถ์ฒ</h1><ul><li>ํ์ฅ๋ ์ง์</li></ul>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/Database/">Database</category>
<category domain="https://sowon-dev.github.io/categories/Database/Oracle/">Oracle</category>
<category domain="https://sowon-dev.github.io/tags/TIL/">TIL</category>
<category domain="https://sowon-dev.github.io/tags/Oracle/">Oracle</category>
<comments>https://sowon-dev.github.io/2024/10/22/241023oracle-query-pivot/#disqus_thread</comments>
</item>
<item>
<title>์ค๋ผํดDB์์ ํ๋ก์์ ์ถ๋ ฅ๊ฐ ๋ณด๋ ๋ฐฉ๋ฒ</title>
<link>https://sowon-dev.github.io/2024/10/22/241023oracleDB-call-procedure/</link>
<guid>https://sowon-dev.github.io/2024/10/22/241023oracleDB-call-procedure/</guid>
<pubDate>Tue, 22 Oct 2024 15:46:18 GMT</pubDate>
<description><p>ํ๋ก์์ ๋ฅผ ์์ฑํ๋ค๊ฐ ์ค๋ผํดDB์์ ๋ฐ๋ก ์ถ๋ ฅ๊ฐ์ ๋ณด๊ณ ์ถ์๋ค.</p></description>
<content:encoded><![CDATA[<p>ํ๋ก์์ ๋ฅผ ์์ฑํ๋ค๊ฐ ์ค๋ผํดDB์์ ๋ฐ๋ก ์ถ๋ ฅ๊ฐ์ ๋ณด๊ณ ์ถ์๋ค.</p><a id="more"></a><h1 id="์ฝ๋"><a href="#์ฝ๋" class="headerlink" title="์ฝ๋"></a>์ฝ๋</h1><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">SET</span> SERVEROUTPUT <span class="keyword">ON</span>;</span><br><span class="line"><span class="keyword">DECLARE</span> </span><br><span class="line"> V_RSLT <span class="built_in">VARCHAR</span>(<span class="number">1</span>);</span><br><span class="line"> V_MSG VARCHAR(1000);</span><br><span class="line"><span class="keyword">BEGIN</span></span><br><span class="line"> PKG_TEST.P_TEST</span><br><span class="line"> (</span><br><span class="line"> IN_YR => <span class="string">'2024'</span></span><br><span class="line"> , IN_CD => <span class="string">'100110'</span></span><br><span class="line"> , IN_NM => <span class="string">'๋ํ์'</span></span><br><span class="line"> , O_RSLT => V_RSLT</span><br><span class="line"> , O_MSG => V_MSG</span><br><span class="line"> );</span><br><span class="line"></span><br><span class="line"> DBMS_OUTPUT.PUT_LINE('RESULT: '|| V_RSLT);</span><br><span class="line"> DBMS_OUTPUT.PUT_LINE('MSG: '|| V_MSG);</span><br><span class="line"><span class="keyword">END</span>;</span><br></pre></td></tr></table></figure><p>๊ธฐ๋ณธ์ ์ผ๋ก Oracle ์๋ฒ๋ DBMS_OUTPUT.PUT_LINE์์ ์์ฑ๋ ๋ฉ์์ง๋ฅผ ์๋์ผ๋ก ๋ณด์ฌ์ฃผ์ง ์๋๋ค.<br>์ด๋ฅผ ํ์ฑํํ๊ธฐ ์ํด <code>SET SERVEROUTPUT ON</code>์ ์ ์ธํด์ค์ผํ๋ค.<br><code>SET SERVEROUTPUT ON</code>์ด ์์ผ๋ฉด PL/SQL ๋ธ๋ก์์ ์ถ๋ ฅ๋ ๋ฉ์์ง๋ ์ฝ์์ ๋ํ๋์ง ์๋๋ค.</p>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/Database/">Database</category>
<category domain="https://sowon-dev.github.io/categories/Database/Oracle/">Oracle</category>
<category domain="https://sowon-dev.github.io/tags/TIL/">TIL</category>
<category domain="https://sowon-dev.github.io/tags/Oracle/">Oracle</category>
<comments>https://sowon-dev.github.io/2024/10/22/241023oracleDB-call-procedure/#disqus_thread</comments>
</item>
<item>
<title>[BookReview]๋ชจ๋์ ๋คํธ์ํฌ ๊ธฐ์ด BY ์์ง์</title>
<link>https://sowon-dev.github.io/2024/05/18/240519bookreview001/</link>
<guid>https://sowon-dev.github.io/2024/05/18/240519bookreview001/</guid>
<pubDate>Sat, 18 May 2024 21:08:34 GMT</pubDate>
<description><p>๋คํธ์ํฌ๊ฐ ๋ถ์กฑํ๋ค๊ณ ์๊ฐํด์ ๋จํธ์ ์ธ ์ ํ๋ธ ์ง์์ด ์๋ ์ฐ๊ฒฐ๋ ์ฑ
์์ ์ ๋ณด๋ฅผ ์ฐพ๊ณ ์ถ์๋ค.<br>๊ทธ๋ ๊ฒ ์ฝ๊ฒ๋ 10์ผ๋ง์ ๋ชจ๋์ ๋คํธ์ํฌ!<br>๊ฐ ์ฅ๋ง๋ค ๋ชฉํ๊ฐ ์์ด์ ์ฝ๊ณ ์์ํ๋ฉด ํจ์ฌ ๋์์ด ๋๋ฉฐ ๊ทธ๋ฆผ์ด ๋ง์์ ์ดํด๊ฐ ์ฝ๊ณ ์ค๋ช
์ด ์๋์ด์๋ค.<br>์ฐ์ต๋ฌธ์ ๋ ์์ด์ ์ค์ค๋ก ํ์ต์ ์ต๊ณ !</p></description>
<content:encoded><![CDATA[<p>๋คํธ์ํฌ๊ฐ ๋ถ์กฑํ๋ค๊ณ ์๊ฐํด์ ๋จํธ์ ์ธ ์ ํ๋ธ ์ง์์ด ์๋ ์ฐ๊ฒฐ๋ ์ฑ
์์ ์ ๋ณด๋ฅผ ์ฐพ๊ณ ์ถ์๋ค.<br>๊ทธ๋ ๊ฒ ์ฝ๊ฒ๋ 10์ผ๋ง์ ๋ชจ๋์ ๋คํธ์ํฌ!<br>๊ฐ ์ฅ๋ง๋ค ๋ชฉํ๊ฐ ์์ด์ ์ฝ๊ณ ์์ํ๋ฉด ํจ์ฌ ๋์์ด ๋๋ฉฐ ๊ทธ๋ฆผ์ด ๋ง์์ ์ดํด๊ฐ ์ฝ๊ณ ์ค๋ช
์ด ์๋์ด์๋ค.<br>์ฐ์ต๋ฌธ์ ๋ ์์ด์ ์ค์ค๋ก ํ์ต์ ์ต๊ณ !</p><a id="more"></a><h1 id="์ง์ง-10์ผ๋ง์-์ฝ์-์-์๋ค"><a href="#์ง์ง-10์ผ๋ง์-์ฝ์-์-์๋ค" class="headerlink" title="์ง์ง 10์ผ๋ง์ ์ฝ์ ์ ์๋ค."></a>์ง์ง 10์ผ๋ง์ ์ฝ์ ์ ์๋ค.</h1><p>์ด 9์ฅ์ผ๋ก ๊ตฌ์ฑ๋์ด์๊ณ ์ด 225์ฅ์ด๋ค. ๊ฐ๋ฒผ์ด ๋จํธ์์ค์์ค์ด๋ผ์ ์ฐจ๊ทผ์ฐจ๊ทผ ์ฝ๊ธฐ๋ง ํ๋ฉด ๋๋ค.<br>10์ผ์ด๊ธฐ๋๋ฌธ์ ์์ฌ3์ผ 3๋ฒ๋ฐ๋ณตํ๋ค๋ณด๋ฉด ์ด๋์๊ฐ ๋ค ์ฝ๊ฒ ๋๋ค.</p><p><br><br><br></p><h1 id="์ถ์ฒํ์ต๋ฐฉ๋ฒ"><a href="#์ถ์ฒํ์ต๋ฐฉ๋ฒ" class="headerlink" title="์ถ์ฒํ์ต๋ฐฉ๋ฒ"></a>์ถ์ฒํ์ต๋ฐฉ๋ฒ</h1><p>ํ์ต์์ด๊ธฐ๋๋ฌธ์ ํ์ต๋ฐฉ๋ฒ์ด ์ค์ํ๋ค.<br>๋๋ ์๋์ ๊ฐ์ด ์งํํ๋ค.</p><ol><li>ํ๋ฃจ์ ํ์ฅ์ฝ๊ธฐ</li><li>๋ชฉํ์ฝ๊ธฐ -> ๋ด์ฉ ์ ๋
-> ๋ณต์ตํ๊ธฐ(๋น์นธ์ฑ์ฐ๊ธฐ)</li></ol><p><img src="/img/240519_145206907_01.jpg" alt="๋ชฉํ"></p><p>๊ฐ ์ฅ๋ง๋ค ๋ชฉํ๊ฐ ์์ด์ ์ฝ๊ณ ์์ํ๋ฉด ํจ์ฌ ๋์์ด ๋๋ค.</p><p>๊ฐ ๋ด์ฉ์๋ ๊ทธ๋ฆผ์ด ๋ง์์ ์ดํด๊ฐ ์ฝ๊ณ ์ค๋ช
์ด ์๋์ด์๋ค.<br>๋ค๋ง, ์ผ์ด๋ธ๋ฑ์ ์ค์ฌ ์ฌ์ง์ ํ๋ฐฑ์ด ์๋ ์ปฌ๋ฌ์์ผ๋ฉด ๋ ์ข์์๋ฏํ๋ค.</p><p><img src="/img/240519_145206907_02.jpg" alt="๋น์นธํด์ฆ"></p><p>๋ง์ง๋ง์๋ ๋ณต์ต์ ์ํ ๋น์นธํด์ฆ๊ฐ ์๋ค.<br>๋น์นธํด์ฆ๊ฐ ์์ผ๋ ์ค์ ๋จ์ด๊ฐ ์์ ์ ๋ฆฌ๋๋ค.</p>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/Journal/">Journal</category>
<category domain="https://sowon-dev.github.io/categories/Journal/Review/">Review</category>
<category domain="https://sowon-dev.github.io/tags/BookReview/">BookReview</category>
<comments>https://sowon-dev.github.io/2024/05/18/240519bookreview001/#disqus_thread</comments>
</item>
<item>
<title>SVN์์ ์ฌ๋ด GITLAB์ผ๋ก ๋ณ๊ฒฝํ๊ธฐ(ft.migration)</title>
<link>https://sowon-dev.github.io/2024/04/02/240403svn-to-git/</link>
<guid>https://sowon-dev.github.io/2024/04/02/240403svn-to-git/</guid>
<pubDate>Tue, 02 Apr 2024 20:29:32 GMT</pubDate>
<description><p>ํ์ฌ SVN์ ์ฌ์ฉํ๊ณ ์๋๋ฐ ์ฌ๋ด GITLAB์๋ฒ๋ก ๋ณ๊ฒฝํ๋ ์
๋ฌด๋ฅผ ๋งก๊ฒ๋์๋ค.<br>GITHUB๋ ์ต์ํ์ง๋ง GITLAB์ ์ต์ํ์ง์์ ์ด๋ฐ์ ์ฝ์งํ ์๊ฐ์ด ์์๋ค.</p></description>
<content:encoded><![CDATA[<p>ํ์ฌ SVN์ ์ฌ์ฉํ๊ณ ์๋๋ฐ ์ฌ๋ด GITLAB์๋ฒ๋ก ๋ณ๊ฒฝํ๋ ์
๋ฌด๋ฅผ ๋งก๊ฒ๋์๋ค.<br>GITHUB๋ ์ต์ํ์ง๋ง GITLAB์ ์ต์ํ์ง์์ ์ด๋ฐ์ ์ฝ์งํ ์๊ฐ์ด ์์๋ค.</p><a id="more"></a><h1 id="1-gitlab์-new-ํ๋ก์ ํธ-์์ฑ"><a href="#1-gitlab์-new-ํ๋ก์ ํธ-์์ฑ" class="headerlink" title="1 gitlab์ new ํ๋ก์ ํธ ์์ฑ"></a>1 gitlab์ new ํ๋ก์ ํธ ์์ฑ</h1><p>์ฌ๋ด gitlab ์๊ฒฉ์๋ฒ์ ์ ๊ท ํ๋ก์ ํธ๋ฅผ ์์ฑํ๋ค.</p><p><br><br><br></p><h1 id="2-gitlab์-SSHํค๋ฅผ-๋ฑ๋กํ๊ธฐ"><a href="#2-gitlab์-SSHํค๋ฅผ-๋ฑ๋กํ๊ธฐ" class="headerlink" title="2 gitlab์ SSHํค๋ฅผ ๋ฑ๋กํ๊ธฐ"></a>2 gitlab์ SSHํค๋ฅผ ๋ฑ๋กํ๊ธฐ</h1><p>SSH ํค๊ฐ ๋ฑ๋ก๋์ง์์ผ๋ฉด COMMIT, PUSH๋ฑ์ ๋ชปํ๋ค.</p><ol><li><p>SSH ํค ์์ฑ์ cmd / gitbash ์์ ์งํ๊ฐ๋ฅํ๋ค. </p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ ssh-keygen -t rsa -b 4096 -C <span class="string">"sowon-dev@example.com"</span></span><br></pre></td></tr></table></figure><p>์ํธ ์ค์ ์ ์ ํ ์ฌํญ์ผ๋ก ์ํธ์ค์ ์ ์ํ์ง ์๋๋ค๋ฉด Enterํค๋ฅผ ๊ณ์ ๋๋ฅด๋ฉด ๋๋ค.</p></li><li><p>์ฌ์ฉ์ ํ ๋๋ ํ ๋ฆฌ์ .ssh ํด๋์ id_rsa (๊ฐ์ธ ํค) ๋ฐ id_rsa.pub (๊ณต๊ฐ ํค) ์ด 2๊ฐ์ ํ์ผ์ด ์์ฑ๋๋ค.</p></li><li><p>SSH ํค ์ฝ๊ธฐ </p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ cat id_rsa.pub</span><br></pre></td></tr></table></figure><p>์ ๋ช
๋ น์ด๋ก ๊ณต๊ฐํค๋ฅผ ์ฝ์์ ํตํด์ ํ์ธํ ์ ์๋ค.<br>๋ณต์ฌํด์ ์ฌ๋ด gitlab ์๊ฒฉ์๋ฒ์ ์ ๊ท ํ๋ก์ ํธ์์ ๊ณ์ ๋ณ๋ก <code>SSH ํค ๋ฑ๋ก</code>์ ๋ถ์ฌ๋ฃ๋๋ค.</p></li></ol><p><br><br><br></p><h1 id="3-๋ก์ปฌ์-gitlabํ๊ฒฝ์กฐ์ฑ"><a href="#3-๋ก์ปฌ์-gitlabํ๊ฒฝ์กฐ์ฑ" class="headerlink" title="3 ๋ก์ปฌ์ gitlabํ๊ฒฝ์กฐ์ฑ"></a>3 ๋ก์ปฌ์ gitlabํ๊ฒฝ์กฐ์ฑ</h1><p>gitlab์ code์์ <code>Clone with HTTP</code>๋ก http://์์ดํผ/testprjt.git ๋ฅผ cloneํ์ฌ ๋ก์ปฌ์ ํ๊ฒฝ ์กฐ์ฑ</p><p><br><br><br></p><h1 id="4-SVN-์ปค๋ฐ-์ด๋ฆฌ๊ธฐ์ํ-user-txt-ํ์ผ-๋ง๋ค๊ธฐ"><a href="#4-SVN-์ปค๋ฐ-์ด๋ฆฌ๊ธฐ์ํ-user-txt-ํ์ผ-๋ง๋ค๊ธฐ" class="headerlink" title="4 SVN ์ปค๋ฐ ์ด๋ฆฌ๊ธฐ์ํ user.txt ํ์ผ ๋ง๋ค๊ธฐ"></a>4 SVN ์ปค๋ฐ ์ด๋ฆฌ๊ธฐ์ํ user.txt ํ์ผ ๋ง๋ค๊ธฐ</h1><p>์ํ๋ ๊ณณ์ users.txt ํ์ผ์ ๋ค์๊ณผ ๊ฐ์ ๋ด์ฉ์ ์์ฑํ๋ค</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">user1 = user1 <user1@email.com></span><br><span class="line">user2 = user2 <user2@email.com></span><br><span class="line">.</span><br><span class="line">.</span><br><span class="line">.</span><br></pre></td></tr></table></figure><p><br><br><br></p><h1 id="5-svn์-git์ผ๋ก-cloneํ๊ธฐ"><a href="#5-svn์-git์ผ๋ก-cloneํ๊ธฐ" class="headerlink" title="5 svn์ git์ผ๋ก cloneํ๊ธฐ"></a>5 svn์ git์ผ๋ก cloneํ๊ธฐ</h1><pre><code class="bash">git svn <span class="built_in">clone</span> <SVN ์ ์ฅ์ URL> --no-metadata -A D:/workspace/svn-gitlab/users.txt D:/workspace/svn-gitlab<span class="built_in">cd</span> D:/workspace/svn-gitlabgit remote add origin <gitlab์ ์๊ฒฉ ์ ์ฅ์ URL>git pull origin main --allow-unrelated-historiesgit push -u origin main</code></pre><p>์ฌ๊ธฐ์ ์ ๋๊ฒฝ๋ก D:/workspace/svn-gitlab๋ gitlab ๋ก์ปฌ์ ์ฅ์๊ฒฝ๋ก์ด๋ค.</p><p><br><br><br></p><h1 id="ํ์ฌ์์ -์-GitLab์-์ฐ๋ผ๊ณ -ํ ๊น"><a href="#ํ์ฌ์์ -์-GitLab์-์ฐ๋ผ๊ณ -ํ ๊น" class="headerlink" title="ํ์ฌ์์ ์ GitLab์ ์ฐ๋ผ๊ณ ํ ๊น?"></a>ํ์ฌ์์ ์ GitLab์ ์ฐ๋ผ๊ณ ํ ๊น?</h1><p>๊ฐ์ฅ ๊ทผ๋ณธ์ ์ธ ์ง๋ฌธ์ด์๋ค.<br>SVN์ ์ค์์ง์ค ๋ฒ์ ๊ด๋ฆฌ ์์คํ
์ด๊ณ Git์ ๋ถ์ฐ ๋ฒ์ ๊ด๋ฆฌ ์์คํ
์ด๋ค.<br>์ค์์ง์ค ๋ฒ์ ๊ด๋ฆฌ ์์คํ
์ ํธํ์ง๋ง commitํ ๋ด์ฉ์ ์ค์๊ฐ ์์ ์์ ์๋ฒ์(๋ค๋ฅธ ๊ฐ๋ฐ์์๊ฒ) ๋ฐ๋ก ์ํฅ์ ๋ฏธ์น๊ฒ ๋๊ณ ๋ง์ฝ ์ค์ ์๋ฒ์ ๋ฌธ์ ๊ฐ ์๊ธฐ๋ฉด ํ์
๋ถ๊ฐ๋ฅํด์ง๋ค.<br>๊ทธ๋ ๋ค๋ฉด ์ต์ํ GitHub๋ณด๋ค ์ GitLab์ ์ฌ์ฉํ๋ผ๊ณ ํ๋ ๊ฒ์ผ๊น?<br>GitHub๋ ์์ค๊ฐ GitHub์ ์๋ค๋ณด๋ ๋ณด์์ ์ทจ์ฝํ๋ค.<br>๋ฐ๋ผ์, ์์ ๋ด๋ถ์์ ๊ด๋ฆฌํ๋ GitLab์ด๋ SVN์ ๊ณ ๊ฐ์ฌ๋ ๋ ์ ํธํ๋ค.</p><p><br><br><br></p><h1 id="์ฐธ๊ณ "><a href="#์ฐธ๊ณ " class="headerlink" title="์ฐธ๊ณ "></a>์ฐธ๊ณ </h1><ul><li><a href="https://sowon-dev.github.io/2020/12/27/201228svn/">SVN๊ณผ GIT ์ฐจ์ด ํฌ์คํ
</a></li><li><a href="https://scvspace.kr/1385">Gitlab์ผ๋ก ์์ค ์ด๊ดํ๊ธฐ(SVN ํน์ ์ ๊ท์์ฑ)</a></li><li><a href="https://garve32.tistory.com/43">SVN์ Git์ผ๋ก Migration ํ๊ธฐ</a></li></ul>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/Version-control/">Version control</category>
<category domain="https://sowon-dev.github.io/tags/GIT/">GIT</category>
<category domain="https://sowon-dev.github.io/tags/SVN/">SVN</category>
<comments>https://sowon-dev.github.io/2024/04/02/240403svn-to-git/#disqus_thread</comments>
</item>
<item>
<title>SSO(Single Sign-On) ํ๋ก์ ํธ๋ฅผ ๋๋ด๋ฉฐ ๋ด๊ฐ ๋ฐฐ์ด ๊ฒ</title>
<link>https://sowon-dev.github.io/2024/04/02/240403prjtreview11/</link>
<guid>https://sowon-dev.github.io/2024/04/02/240403prjtreview11/</guid>
<pubDate>Tue, 02 Apr 2024 20:23:06 GMT</pubDate>
<description><p>์ด๋ฒ ํ๋ก์ ํธ์์๋ ๊ฐ์ธ์ ๋ณด๊ด๋ฆฌํ์ด์ง(๋ง์ดํ์ด์ง)๋ฅผ ์ฃผ ์
๋ฌด๋ก ๋งก์๋ค.<br>ํธ๋ฆฌํจ๊ณผ ์ด๋ ค์์ด ๊ณต์กดํ ํ๋ก์ ํธ์๋๋ฐ ์๋์ ๊ฐ๋ค.</p></description>
<content:encoded><![CDATA[<p>์ด๋ฒ ํ๋ก์ ํธ์์๋ ๊ฐ์ธ์ ๋ณด๊ด๋ฆฌํ์ด์ง(๋ง์ดํ์ด์ง)๋ฅผ ์ฃผ ์
๋ฌด๋ก ๋งก์๋ค.<br>ํธ๋ฆฌํจ๊ณผ ์ด๋ ค์์ด ๊ณต์กดํ ํ๋ก์ ํธ์๋๋ฐ ์๋์ ๊ฐ๋ค.</p><a id="more"></a><p>ํธ๋ฆฌํจ</p><ol><li>์คํ๋ง๋ถํธ์ ํธ๋ฆฌํจ์ ๊ฐํํ๋ค. ์์
ํ๋ ๋์ ์๋ฒ๋๋ฌธ์ ๋ถํธํ ์ผ์ด ๊ฑฐ์ ์์๋ค.</li><li>Thymeleaf ๊ฐํธํจ์ ๊ฐํํ๋ค. JSTL๊ณผ EL์ฌ์ฉํ๋๋ฐ ์์ ์ต์ด์ ์ด๋ฐ์ ์กฐ๊ธ ๋ฒ๋ฒ
๊ฑฐ๋ ธ์ง๋ง ์ด๋ด Thymeleaf์ ๊ฐ๋
์ฑ ๋์ ํํ๋ฐฉ๋ฒ์ ๋ฐํด๋ฒ๋ ธ๋ค.</li></ol><p>์ด๋ ค์</p><ol><li>์ด๋ฒ ์์
์ ๊ฝค๋ ์ด๋ ค์ ๋๋ฐ ๊ทธ ์ด์ ๋ ํด๋ผ์ด์ธํธ์ ๋นํ์กฐ๋ก ๋ ๊ฑฐ์์ ์กฐ๊ฐ์กฐ๊ฐ๋ ์ฟผ๋ฆฌ๋ฅผ ๋ฐ์์ ์์
ํด์ผํ๊ธฐ ๋๋ฌธ์ด๋ค. ํ
์ด๋ธ๊ณผ ์ปฌ๋ผ, ๋ฐ์ดํฐ๋ ์๋ ค์ฃผ์ง์์์, ํ
์ด๋ธ๊ณผ ํ๋ก์์ ๋ฅผ ์์ํ๊ณ ์ ์ถํ๋ฉด์ ์์
์ ์งํํด์ผํ๋ค. ๋๋ถ์ ์ ๋ณด๊ฐ ๋ถ์ถฉ๋ถํ ์ํฉ์์๋ ์๊ตฌ์ฌํญ๋๋ก ๊ธฐ๋ฅ์ ๊ตฌํํ๋ ๋ฅ๋ ฅ์ ํค์ธ ์ ์์๋ค. </li></ol><p>์ด๋ ๊ฒ ํ๋ก์ ํธ ๊ฒฝํ์น๊ฐ ์ฐจ๊ณก์ฐจ๊ณก ์์ด๊ณ ์๋ค. ์ข์ ๊ฑฐ๋ง์ง..?!</p><p><br><br><br></p><h1 id="keep"><a href="#keep" class="headerlink" title="keep"></a>keep</h1><p>ํ์ฌ ๋ง์กฑํ๊ณ ์๋ ๋ถ๋ถ๊ณผ ๊ณ์ํด์ ์ด์ด๊ฐ์ผ๋ฉด ํ๋ ๋ถ๋ถ</p><ol><li>Thymeleaf ์ ๊ทน ํ์ฉ<ul><li><code>th:block</code> ๋ฅผ ์ฌ์ฉํ์ฌ ๋
ผ๋ฆฌ์ ์ฝ๋ ๋ธ๋กํํ์ฌ ๊ฐ๋
์ฑ ๋์์ผ๋ฉฐ Thymeleaf๋ง์ formatting utilities๋ฅผ ์ฌ์ฉํ์ฌ ํธ๋ฆฌํ๊ฒ ์์
ํ ์ ์์๋ค.<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">//์์ฃผ ์ฌ์ฉํ๋ formatting utilities</span><br><span class="line">${#strings.isEmpty()}</span><br><span class="line">${#calendars.format()}</span><br></pre></td></tr></table></figure></li></ul></li><li>์ฌ์ฉ์๋ณ ๊ถํ๋ณ ๋ฐ๋ก๊ฐ๊ธฐ ๋ฉ๋ด ๊ตฌํ<ul><li>๋ฐ๋ก๊ฐ๊ธฐ ๋ฉ๋ด๋ฅผ ๋ง๋๋๋ฐ ์ฌ์ฉ์๋ณ๋ก ์ํ๋ ๋ฉ๋ด๋ค์ ์์๋๋ก ์ง์ ํ ์ ์๊ณ ์ฌ์ฉ์๊ฐ ์์ ์ ๋ฐ๋ก๊ฐ๊ธฐ๋ฉ๋ฅ๋ฅผ ์ง์ ํ์ง์์๋ค๋ฉด ์์คํ
๊ด๋ฆฌ์๊ฐ ๊ถํ(role)๋ณ๋ก ์ค์ ํด๋์ ๋ฐ๋ก๊ฐ๊ธฐ๋ฅผ ์์๋๋ก ๋ณด์ฌ์ฃผ๋ ๊ฒ์ ๊ตฌํํ๋ค. ์์๋๋ก๋ฅผ ์ด๋ป๊ฒ ๊ตฌํํ ์ง ๊ณ ๋ฏผํ๋๋ฐ Array๋ฅผ ์ฌ์ฉํด์ ํด๋ฆญ ์์๋๋ก <code>Array.push()</code>ํ๊ณ ์ ๊ฑฐ์ ํด๋น index์ ์์๋ฅผ ์ญ์ ํ๋ฉด์ Array ์์๊ฐ ๊ทธ๋๋ก ์ ์ง๋ ์ ์๋๋ก ๊ตฌํํ๋ค.</li></ul></li><li>ํ์ด๋จธ ๋ง๋ค๊ธฐ: setInterval์ ํ์ฉํ์ฌ 3๋ถ ํ์ด๋จธ ๊ตฌํ<ul><li>์ค๋๋ง์ ํจ์๋ก ๋ง๋๋๊น ์ฌ๋ฐ์๋ค.</li></ul></li><li>jQuery ๋น์ค์ ์ค์ด๊ณ Vanilla JS ์ฌ์ฉ<ul><li>์ง๋ ํ๋ก์ ํธ๋ถํฐ ์์์ ์ผ๋ก jQuery ์ฌ์ฉ์ ์ค์ด๊ณ Vanilla JS๋ฅผ ๋ ๋ง์ด ์ฌ์ฉํ๋ค. ๋ฐ๋๋ผJS๋ ์ ์ด์ฟผ๋ฆฌ๋ณด๋ค ์ฝ๋๋ ๊ธธ์ด์ง์ง๋ง ์ ์ด์ฟผ๋ฆฌAPI๋ฅผ ๋ค๋
์ค์ง์์๋ ๋๊ธฐ์ ์๋๊ฐ ๋น ๋ฅด๋ค. ์ด๋ฏธ ์์ ์ต์ด๋ฒ๋ฆฐ jQuery๋ฅผ ์์์ ์ผ๋ก ๋ฐ๋๋ผJS๋ฅผ ์ฌ์ฉํ๋ ค๋ ์ฒ์์๋ ๋ฒ๋ฒ
๊ฑฐ๋ ธ์ง๋ง ํ๋ก์ ํธ ๊ฐ์๋ก ์ฝ๋ฉ์๋๊ฐ ๋ถ์๋ค. ๋ค์ ํ๋ก์ ํธ๋ ๋ฐ๋๋ผJS๋ฅผ ์์์ ์ผ๋ก ์ฌ์ฉํด์ผ๊ฒ ๋ค.</li></ul></li><li>SVN ์ ์ฅ์์์ GitLab์ผ๋ก ๋ง์ด๊ทธ๋ ์ด์
ํ๊ธฐ<ul><li>๋จ๋
์ผ๋ก ๋ง์ด๊ทธ๋ ์ด์
์ ๋ด๋นํ ๊ฒ์ด ์ฒ์์ด๋ผ์ ์ฌ๋ฐ์๋ค.</li><li>๊ด๋ จ ํฌ์คํ
: <a href="https://sowon-dev.github.io/2024/04/02/240403svn-to-git/">SVN์์ ์ฌ๋ด GitLab์ผ๋ก ๋ณ๊ฒฝํ๊ธฐ(ft.migration)</a></li></ul></li></ol><p><br><br><br></p><h1 id="Problem"><a href="#Problem" class="headerlink" title="Problem"></a>Problem</h1><p>๊ฐ์ ์ด ํ์ํ๋ค๊ณ ์๊ฐ๋๋ ๋ถ๋ถ</p><ol><li>์ค๋ผํด DB ํ๋ก์์ mybatis์ ์ฐ๋ํ์ฌ ์ฌ์ฉ๋ฒ<figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><select id="callSampleProcedure" statementType="CALLABLE"></span><br><span class="line"> { call SAMPLE_PROCEDURE(</span><br><span class="line"> <span class="comment">#{param1, mode=IN, jdbcType=VARCHAR},</span></span><br><span class="line"> <span class="comment">#{param2, mode=OUT, jdbcType=VARCHAR}</span></span><br><span class="line"> )}</span><br><span class="line"></select></span><br></pre></td></tr></table></figure></li></ol><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Map<String, Object> parameterMap = <span class="keyword">new</span> HashMap<>();</span><br><span class="line">parameterMap.put(<span class="string">"param1"</span>, <span class="string">"input_value"</span>);</span><br><span class="line">parameterMap.put(<span class="string">"param2"</span>, <span class="keyword">null</span>); <span class="comment">// Output ํ๋ผ๋ฏธํฐ๋ ์ ์ธํด์ค์ผ</span></span><br></pre></td></tr></table></figure><p>statementType=โCALLABLEโ ์ ์ฌ์ฉํ์ฌ ํ๋ก์์ ๋ฅผ ํธ์ถํด์ผํ๋ค. ๊ทธ๊ฑธ ๋ชจ๋ฅด๊ณ ์ผ๋ง๋ ์ฝ์งํ๋์งโฆ ๋ํ outํ๋ผ๋ฏธํฐ๋ null๋ก ์ ์ธํด์ค์ผํ๋ค.</p><p><br><br><br></p><h1 id="Try"><a href="#Try" class="headerlink" title="Try"></a>Try</h1><p>Problem์ ํด๊ฒฐ์ฑ
์ด ๋ ์ ์๋ ๋ถ๋ถ</p><ol><li>๋คํธ์ํฌ ๊ณต๋ถ๋ฅผ ํ๋ฉด์ ๊ฒธ์ฌ๊ฒธ์ฌ ๋คํธ์ํฌ ๊ด๋ฆฌ์ฌ2๊ธ๋ฅผ ์ทจ๋ํ ๊ฒ์ด๋ค.<ul><li>ONE ACTION: 24๋
์ 03ํ ํ๊ธฐ์ ์ฒญ 2024-07-26, ํ๊ธฐ์์ 2024-08-25, ์ค๊ธฐ 2024-09-29 ์ต์ข
ํฉ๊ฒฉ๋ฐํ 2024-10-08</li></ul></li><li>Oracle DB ๊ณต๋ถ</li></ol>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/Journal/">Journal</category>
<category domain="https://sowon-dev.github.io/categories/Journal/%ED%9A%8C%EA%B3%A0%EB%A1%9D/">ํ๊ณ ๋ก</category>
<category domain="https://sowon-dev.github.io/tags/%ED%9A%8C%EA%B3%A0%EB%A1%9D/">ํ๊ณ ๋ก</category>
<comments>https://sowon-dev.github.io/2024/04/02/240403prjtreview11/#disqus_thread</comments>
</item>
<item>
<title>[GIT]reset๊ณผ revert์ ์ฐจ์ด</title>
<link>https://sowon-dev.github.io/2024/03/08/240309-reset-vs-revert/</link>
<guid>https://sowon-dev.github.io/2024/03/08/240309-reset-vs-revert/</guid>
<pubDate>Fri, 08 Mar 2024 07:23:52 GMT</pubDate>
<description><p>์ค๋ ํ ํ์ ๊ผฌ์ฌ๋ฒ๋ฆฐ ์ปค๋ฐ์ ํด๊ฒฐํ๋ฉด์ reset๊ณผ revert๋ฅผ ์ฌ์ฉํ๋ค.<br>์ค๋๋ง์ ์ฐ๋ค๋ณด๋ ๊ธฐ์ต์ด ์ ์๋์ ์์ ์ ์ด ํฌ์คํ
๋ฅผ ๋ดค๋๋ฐ ๋ด์ฉ์ด ๋ถ์กฑํด์ ๋ณด์์ ํด๋ดค๋ค.</p></description>
<content:encoded><![CDATA[<p>์ค๋ ํ ํ์ ๊ผฌ์ฌ๋ฒ๋ฆฐ ์ปค๋ฐ์ ํด๊ฒฐํ๋ฉด์ reset๊ณผ revert๋ฅผ ์ฌ์ฉํ๋ค.<br>์ค๋๋ง์ ์ฐ๋ค๋ณด๋ ๊ธฐ์ต์ด ์ ์๋์ ์์ ์ ์ด ํฌ์คํ
๋ฅผ ๋ดค๋๋ฐ ๋ด์ฉ์ด ๋ถ์กฑํด์ ๋ณด์์ ํด๋ดค๋ค.</p><a id="more"></a><h1 id="reset๊ณผ-revert์-์ฐจ์ด"><a href="#reset๊ณผ-revert์-์ฐจ์ด" class="headerlink" title="reset๊ณผ revert์ ์ฐจ์ด"></a>reset๊ณผ revert์ ์ฐจ์ด</h1><ul><li>revert: ์ปค๋ฐ์ ์ทจ์ํ๋ค๊ณ ์ปค๋ฐ์ ๋จ๊ธฐ๋ฉฐ ๋๋๋ฆผ.</li><li>reset: ์ปค๋ฐ์ ์์ฑํ ๊ฑธ ์์ ๋๋๋ฆผ. ์ด์ ์ปค๋ฐ๊ธฐ๋ก์ ์ญ์ .<ul><li>ํ๋ก๋์
์ ์ฌ๋ผ๊ฐ ์ปค๋ฐ์ reset์ ํ๋ฉด ์๋๋ค. ํ์คํ ๋ฆฌ๊ฐ ์ ๋จ๊ธฐ๋๋ฌธ.</li></ul></li></ul><table><thead><tr><th align="center"></th><th align="left">๋ก๊ทธ</th><th align="left">์ถ์ฒ ์ฌ์ฉ์ํฉ</th></tr></thead><tbody><tr><td align="center">reset</td><td align="left">์์ฑX</td><td align="left">๋ก์ปฌ ์ ์ฅ์์์ ์์
์ ์ฌ์ฉ ์ถ์ฒ</td></tr><tr><td align="center">revert</td><td align="left">์์ฑO</td><td align="left">์๊ฒฉ์ ์ฅ์์ ์ด๋ฏธ ์ฌ๋ ธ์๋ ์ฌ์ฉ ์ถ์ฒ</td></tr></tbody></table><p><br><br></p><h1 id="์ทจ์-๊ธฐ๋ก์-๋จ๊ธฐ๋ฉด์-์ปค๋ฐ์ทจ์ํ๋-revert"><a href="#์ทจ์-๊ธฐ๋ก์-๋จ๊ธฐ๋ฉด์-์ปค๋ฐ์ทจ์ํ๋-revert" class="headerlink" title="์ทจ์ ๊ธฐ๋ก์ ๋จ๊ธฐ๋ฉด์ ์ปค๋ฐ์ทจ์ํ๋ revert"></a>์ทจ์ ๊ธฐ๋ก์ ๋จ๊ธฐ๋ฉด์ ์ปค๋ฐ์ทจ์ํ๋ revert</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git revert ์ปค๋ฐ๋๋ฒ --์ต์
</span><br></pre></td></tr></table></figure><p>๋ง์ฝ ์ปค๋ฐ๋๋ฒ๊ฐ c,b,a์์ผ๋ก ์๊ณ a๋ฒ์ผ๋ก ๋๋๋ฆฌ๊ณ ์ถ๋ค๋ฉด ์๋ ๋ช
๋ น์ด๋ฅผ ์
๋ ฅํ๋ฉด ๋๋ค.</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">1. ์ปค๋ฐ์์ ํ์ธํ๊ธฐ</span><br><span class="line">git log --oneline</span><br><span class="line">- c์ปค๋ฐ blahblah</span><br><span class="line">- b์ปค๋ฐ blahblah</span><br><span class="line">- a์ปค๋ฐ blahblah</span><br><span class="line"></span><br><span class="line">2. ์ทจ์ํ๊ณ ์ถ์ ์ปค๋ฐ๋๋ฒ๋ก ์ทจ์ํ๊ธฐ</span><br><span class="line">git revert b์ปค๋ฐ๋๋ฒ --hard</span><br></pre></td></tr></table></figure><p>์ด์ c,b์ปค๋ฐ์ ์ทจ์๋๊ณ a์ปค๋ฐ๋ง ๋จ๊ฒ ๋๋ค.<br>๊ทธ๋ผ c,b์ปค๋ฐ์ staged๋์๋ ํ์ผ๋ค์ ์ด๋ป๊ฒ ๋ ๊น?<br>staging Area์ ์ธ working directory๋ก ๊ฐ๊ฒ ๋๋ค!</p><p><br><br></p><h1 id="์๋ฌด๋-๋ชจ๋ฅด๊ฒ-์ปค๋ฐ์-์ทจ์ํ๋-reset"><a href="#์๋ฌด๋-๋ชจ๋ฅด๊ฒ-์ปค๋ฐ์-์ทจ์ํ๋-reset" class="headerlink" title="์๋ฌด๋ ๋ชจ๋ฅด๊ฒ ์ปค๋ฐ์ ์ทจ์ํ๋ reset"></a>์๋ฌด๋ ๋ชจ๋ฅด๊ฒ ์ปค๋ฐ์ ์ทจ์ํ๋ reset</h1><p>reset์ ์ฃผ์์ฌํญ์ด ์๋ค!</p><ul><li>์ฃผ์: reset์ ๋ก์ปฌ ์ ์ฅ์์์๋ง ์คํํ ๊ฒ</li></ul><p>์๊ฒฉ์ ์ฅ์์ ์ฌ๋ผ๊ฐ ๋ค reset์ ์คํํ๋ฉด ์ด์ ์ปค๋ฐ ๋ด์ญ๋ค์ด ์ ๋ถ ์ญ์ ๋๋ค.<br>๋ง์ฝ ๋ค๋ฅธ ๊ฐ๋ฐ์๋ค๊ณผ ํจ๊ป ์์
ํ๋๋ฐ reset์ ํ ๊ฑธ ๋ชจ๋ฅธ์ฑ๋ก ์ปค๋ฐ์ ํ๋ฉด ์ญ์ ํ ์ปค๋ฐ๋ค์ด ๋ค์ ์ด์๋๋ค.<br>๋ฐ๋ผ์ ๋ฏธ๋ฆฌ ๊ณต์ง๋ฅผ ํ๊ฑฐ๋ <code>git revert์ฌ์ฉ์ ์ถ์ฒ</code>ํ๋ค.</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git reset ์ปค๋ฐ๋๋ฒ --์ต์
</span><br><span class="line">git reset b์ปค๋ฐ๋๋ฒ --hard</span><br></pre></td></tr></table></figure><p><br><br></p><h1 id="๊ฐ์ฅ-์ต๊ทผ-commit-ํ๊ฐ-์ทจ์ํ๊ธฐ"><a href="#๊ฐ์ฅ-์ต๊ทผ-commit-ํ๊ฐ-์ทจ์ํ๊ธฐ" class="headerlink" title="๊ฐ์ฅ ์ต๊ทผ commit ํ๊ฐ ์ทจ์ํ๊ธฐ"></a>๊ฐ์ฅ ์ต๊ทผ commit ํ๊ฐ ์ทจ์ํ๊ธฐ</h1><p>๊ฐ์ฅ ์ต๊ทผ ์ปค๋ฐ์ ์ญ์ ํ๊ธฐ ์ํด์ ๊ฐ์ฅ ์ต๊ทผ ์ปค๋ฐ์ ๊ฐ๋ฆฌํค๋ HEAD๊ฐ ์ด๋์๋์ง ์ค์ํ๋ค.</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">1. HEAD์์น ํ์ธ</span><br><span class="line">$ git log --oneline</span><br><span class="line"></span><br><span class="line">2. HEAD์ ์ปค๋ฐ ํ๊ฐ ์ญ์ </span><br><span class="line">$ git reset --hard HEAD~1</span><br><span class="line"></span><br><span class="line">3. ์ญ์ ํ ์ต์ commit ํ์ธ</span><br><span class="line">$ git log --oneline</span><br></pre></td></tr></table></figure><p><br><br></p><h1 id="์ต์
"><a href="#์ต์
" class="headerlink" title="์ต์
"></a>์ต์
</h1><ul><li>soft: ์ทจ์ํ ์ปค๋ฐ์์ ์์
ํ์ผ๋ค์ staging๋จ๊ณ๋ก ๋๋ฆฐ๋ค. ๋ฐ๋ผ์ add๋์ด์๋ค.</li><li>hard: ์ทจ์ํ ์ปค๋ฐ์์ ์์
ํ์ผ๋ค์ working directory๋จ๊ณ๋ก ๋๋ฆฐ๋ค. ๋ฐ๋ผ์ add๋์ด์์ง๋ ์๋ค.</li></ul>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/Spring/">Spring</category>
<category domain="https://sowon-dev.github.io/tags/GIT/">GIT</category>
<comments>https://sowon-dev.github.io/2024/03/08/240309-reset-vs-revert/#disqus_thread</comments>
</item>
<item>
<title>[๋คํธ์ํฌ] Socket(์์ผ) vs Websocket(์น์์ผ) ์ฐจ์ด์ </title>
<link>https://sowon-dev.github.io/2024/01/10/240111websocket-vs-tcpipsocket/</link>
<guid>https://sowon-dev.github.io/2024/01/10/240111websocket-vs-tcpipsocket/</guid>
<pubDate>Wed, 10 Jan 2024 16:46:25 GMT</pubDate>
<description><p>์ค๋ ํ์ฅ๋๊ณผ ์ปคํผ์ฑ์ ํ๋ฉด์ ์์ผ์ด์ผ๊ธฐ๋ฅผ ํ๋ค.<br>๋ด๊ฐ ์๊ณ ์๋ ์์ผ์ ํด๋ผ์ด์ธํธ์ ์์ฒญ์์ด ์๋ฒ๊ฐ ์๋ตํ๋ ๊ฒ์ด์๋๋ฐ ์ค๋ ํ์ฅ๋ ๋ง์์ ๋ค์ด๋ณด๋๊น ๋ญ๊ฐ ๋ค๋ฅธ ๋ด์ฉ์ด์๋ค.</p></description>
<content:encoded><![CDATA[<p>์ค๋ ํ์ฅ๋๊ณผ ์ปคํผ์ฑ์ ํ๋ฉด์ ์์ผ์ด์ผ๊ธฐ๋ฅผ ํ๋ค.<br>๋ด๊ฐ ์๊ณ ์๋ ์์ผ์ ํด๋ผ์ด์ธํธ์ ์์ฒญ์์ด ์๋ฒ๊ฐ ์๋ตํ๋ ๊ฒ์ด์๋๋ฐ ์ค๋ ํ์ฅ๋ ๋ง์์ ๋ค์ด๋ณด๋๊น ๋ญ๊ฐ ๋ค๋ฅธ ๋ด์ฉ์ด์๋ค.</p><a id="more"></a><p>์๊ณ ๋ณด๋ ํ์ฅ๋์ ์์ผํต์ ์ ์๊ธฐํ์
จ๋๋ฐ ๋ด๊ฐ ์น์์ผ์ผ๋ก ์คํดํ๊ธฐ๋๋ฌธ์ด๋ค.<br>์ด์ฐธ์ ๋ ์ฐจ์ด๋ฅผ ๊ณต๋ถํด๋ดค๋ค.<br>๋ด๊ฐ ์ ์ผ ๋ถ์กฑํ ๋ถ๋ถ์ ๋คํธ์ํฌ์ธ ๋ฏํ๋ค. ์ฌํด๋ ์ด ๋ถ๋ถ์ ๋ํด ์ง์ค์ ์ผ๋ก ๊ณต๋ถํด๋ด์ผ๊ฒ ๋ค. </p><h1 id="Socket-์์ผ"><a href="#Socket-์์ผ" class="headerlink" title="Socket(์์ผ)"></a>Socket(์์ผ)</h1><p><img src="/img/240111OSI7LayerAndTCPIP.jpg" alt="ํด์๋ท"></p><ul><li>OSI 7๊ณ์ธต์ ๋คํธ์ํฌ๋ฅผ ๊ด๋ฆฌํ๋ ๊ณ์ธต์ด๋ค. ๊ณ์ธต๋ณ ๊ฐ ํ๋กํ ์ฝ, ์ฆ ํต์ ๊ท์ฝ์ด ์กด์ฌํ๋ค. ํ๋กํ ์ฝ์ ๊ตฌํํ๋ ค๋ฉด ๊ตฌ์ฒด์ ์ธ ๊ตฌํ๋ถ์ธ ํจ์๊ฐ ํ์ํ๋ค.</li><li>์์ผ์ด๋? ๋ณ๋์ ๊ตฌํ์์ด ์์ผ์ ์ด์ฉํ์ฌ ํ๋กํ ์ฝ ํจ์์ BODY๋ฅผ ๋ง๋ค ์ ์๋ค. ์ผ๋ฐ์ ์ผ๋ก TCP/IP๋ฅผ ์ฌ์ฉํ๋ค. <ul><li>์ฐ๊ฒฐ์ญํ : ์ผ์ข
์ endpoint๋ก IP์ ์๋น์คํฌํธ๋ฅผ ํตํด์ ๋ ๊ฐ์ ์ํํธ์จ์ด๋ฅผ ์ฐ๊ฒฐํ๋ค.</li><li>๋ฐ์ดํฐ์ก์์ ์ญํ : ๋ ๊ฐ์ ์ํํธ์จ์ด๋ฅผ ์ฐ๊ฒฐํ๊ณ ๋ฐ์ดํฐ๋ฅผ ์ก์์ ํ๋ค.</li><li>์ข
๋ฅ: ํด๋ผ์ด์ธํธ ์์ผ, ์๋ฒ ์์ผ</li></ul></li><li>TCP/IP 4๊ณ์ธต ์ค ์ ์ก๊ณ์ธต์์ ์ฌ์ฉ๋จ<ul><li>TCPํต์ ์ด๋? <a href="https://sowon-dev.github.io/2021/07/30/210730TCPVSUDP/">TCPํต์ vs UDPํต์ ์ฐจ์ด์ </a></li></ul></li></ul><p><br><br><br></p><h1 id="Websocket-์น์์ผ-๊ณผ์-์ฐจ์ด์ "><a href="#Websocket-์น์์ผ-๊ณผ์-์ฐจ์ด์ " class="headerlink" title="Websocket(์น์์ผ)๊ณผ์ ์ฐจ์ด์ "></a>Websocket(์น์์ผ)๊ณผ์ ์ฐจ์ด์ </h1><ul><li><a href="https://sowon-dev.github.io/2023/01/26/230127resttemplate-vs-websocket/">์น์์ผ</a>์ด๋? ์๋ฒ๊ฐ ํด๋ผ์ด์ธํธ์๊ฒ ๋จผ์ ๋ง(๋ฉ์ธ์ง)์ ๊ฑธ ์ ์๋ค. ์ฆ, ํด๋ผ์ด์ธํธ ์์ฒญ์์ด๋ ์๋ฒ๊ฐ ํด๋ผ์ด์ธํธ์ ์๋ต๊ฐ๋ฅ!</li><li>Socket(์์ผ)๊ณผ ์ฐจ์ด์ ? <ul><li>๋์๊ณ์ธต: ์์ผ์ ์ธํฐ๋ทํ๋กํ ์ฝ์ ๊ธฐ๋ฐํ๋ฏ๋ก TCP๊ฐ ์ํ OSI 4๊ณ์ธต์์ ์ด๋ฃจ์ด์ง๊ณ ์น์์ผ์ TCP์ ์์กดํ์ง๋ง HTTP๊ธฐ๋ฐ์ด๋ฏ๋ก 7๊ณ์ธต์์ ์ด๋ฃจ์ด์ง</li><li>๋ฐ์ดํฐํ์: TCP์ ๊ธฐ๋ฐํ ์์ผํต์ ์ ๋จ์ํ ๋ฐ์ดํธ๋ก ์ด๋ฃจ์ด์ง ๋ฐ์ดํฐ, ์น์์ผํต์ ์ ๋ฉ์์งํ์์ ๋ฐ์ดํฐ</li></ul></li></ul><p>์ฌ์ค ์์ผ๊ณผ ์น์์ผ์ ์์ ๋ค๋ฅธ ๊ฐ๋
์ด ์๋๋ค. ์์ผํต์ ์ ์น์ดํ๋ฆฌ์ผ์ด์
์ ๋ง๊ฒ ๋์์ธํ ๊ฒ์ด ์น์์บฃ์ด๋ค.</p><p><br><br><br></p><h1 id="์ฌ๋ด"><a href="#์ฌ๋ด" class="headerlink" title="์ฌ๋ด"></a>์ฌ๋ด</h1><p>ํ์ฅ๋๊ป ๋คํธ์ํฌ ๊ณต๋ถ๋ฅผ ์ด๋ป๊ฒ ํ๋ฉด ์ข์์ง ์กฐ์ธ์ ๋ถํ๋๋ฆฌ๋ <a href="https://www.icqa.or.kr/cn/page/network">๋คํธ์ํฌ๊ด๋ฆฌ์ฌ ์๊ฒฉ์ฆ</a>์ด ์๋ค๊ณ ์๋ ค์ฃผ์
จ๋ค.<br>์ฌํด๋ ์ด ์๊ฒฉ์ฆ์ ์ทจ๋ํด๋ด์ผ๊ฒ ๋ค!</p><p><br><br><br></p><h1 id="์ฐธ๊ณ "><a href="#์ฐธ๊ณ " class="headerlink" title="์ฐธ๊ณ "></a>์ฐธ๊ณ </h1><ul><li><a href="https://sowon-dev.github.io/2023/01/26/230127resttemplate-vs-websocket/">RestTemplate(๋ ์คํธํ
ํ๋ฆฟ)๊ณผ Websocket(์น์์ผ)์ฐจ์ด์ </a></li><li><a href="https://sowon-dev.github.io/2021/07/30/210730TCPVSUDP/">TCPํต์ vs UDPํต์ ์ฐจ์ด์ </a></li><li><a href="https://velog.io/@rhdmstj17/%EC%86%8C%EC%BC%93%EA%B3%BC-%EC%9B%B9%EC%86%8C%EC%BC%93-%ED%95%9C-%EB%B2%88%EC%97%90-%EC%A0%95%EB%A6%AC-1">Konseo - ์์ผ๊ณผ ์น์์ผ</a></li></ul>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/Network/">Network</category>
<category domain="https://sowon-dev.github.io/tags/%EC%B0%A8%EC%9D%B4/">์ฐจ์ด</category>
<category domain="https://sowon-dev.github.io/tags/Websocket/">Websocket</category>
<comments>https://sowon-dev.github.io/2024/01/10/240111websocket-vs-tcpipsocket/#disqus_thread</comments>
</item>
<item>
<title>์์ฝ, ๋๊ด, ๋์ฌํ๋ก๊ทธ๋จ ํ๋ก์ ํธ๋ฅผ ๋๋ด๋ฉฐ ๋ด๊ฐ ๋ฐฐ์ด ๊ฒ</title>
<link>https://sowon-dev.github.io/2024/01/10/240111prjtreview10/</link>
<guid>https://sowon-dev.github.io/2024/01/10/240111prjtreview10/</guid>
<pubDate>Wed, 10 Jan 2024 15:13:12 GMT</pubDate>
<description><p>์ด๋ฒ ํ๋ก์ ํธ์์๋ ์์ฝ, ๋๊ด, ๋์ฌํ๋ก๊ทธ๋จ์ ์ฃผ ์
๋ฌด๋ก ๋งก์๋ค.</p></description>
<content:encoded><![CDATA[<p>์ด๋ฒ ํ๋ก์ ํธ์์๋ ์์ฝ, ๋๊ด, ๋์ฌํ๋ก๊ทธ๋จ์ ์ฃผ ์
๋ฌด๋ก ๋งก์๋ค.</p><a id="more"></a><p>ํ๋ก์ ํธ๋ง๋ค ์์ฝ,๋๊ด,๋์ฌ๋ฑ์ ๋๋งก์ผ๋ฉด์ ์ผ์ ๊ณผ ๊ด๋ จ๋ DB์ค๊ณ์ ๋ฌ๋ ฅํํ๋ถ๋ถ์ ์ด์ ์ต์ํด์ก๋ค.<br>๋ํ ๋์ ํ
์ด๋ธ๋ ํธํ๊ฒ ๋ง๋ค ์ ์๊ฒ ๋์๋ค.<br>์ด๋ฒ์๋ ์ฒ์์ผ๋ก JsRender๋ฅผ ํ์ฉํ๋๋ฐ template์ ํ์ฉํ ๋ฐ์ดํฐ๋ฐ์ธ๋ฉ์ด ๋๋ฌด ํธํด์ ์ข์๋ค.<br>์ด๋ฒ ํ์ ์ ์๊ฐ์ด ์ด๋ฐํ๋ฐ ํด์ผํ ์์
๋ค์ ๋ฐฉ๋ํด์ ์๊ฐ๋ถ๋ฐฐ๊ฐ ์ค์ํ๋ค.<br>์ง์คํด์ ์์ํ ์
๋ฌด๋ฅผ ๋นจ๋ฆฌ ์ณ๋ด๊ณ ํฐ ์์
์ ์ง๋ํ๊ฒ ๊ตฌํํ๊ธฐ ์ํด ๋
ธ๋ ฅํ๋๋ฐ ๊ฒฐ๋ก ์ ์ผ๋ก ์ ๋์ ๋คํ์ด๋ค.</p><h1 id="keep"><a href="#keep" class="headerlink" title="keep"></a>keep</h1><p>ํ์ฌ ๋ง์กฑํ๊ณ ์๋ ๋ถ๋ถ๊ณผ ๊ณ์ํด์ ์ด์ด๊ฐ์ผ๋ฉด ํ๋ ๋ถ๋ถ</p><ol><li><code>๋๊ด,๋์ฌ,์์ฝ ๊ธฐ๋ฅ ๊ตฌํ์ moment.js ํ์ฉ</code><ul><li>๋๊ด,์์ฝ ๊ธฐ๋ฅ ๊ตฌํ์ moment.js ํ์ฉํ์ฌ ๋ ์ง์ ์๊ฐ์ ํจ๊ณผ์ ์ผ๋ก ๋ค๋ค๊ณ ๋ฌ๋ ฅ์ ํ์ฌ ํ๋ ์์ํฌ ๋ด ๊ฒฝ๋๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ก ์ ํฉํ JsRender๋ฅผ ์ ํํ์ฌ ์ฝ๋ ๋ฐ๋ณต์ ์ต์ํํ๊ณ ํจ์จ์ ์ผ๋ก ์์ฑํ๋ค. JsRender๋ฅผ ์ด๋ฒ์ ์ฒ์ ์จ๋ดค๋๋ฐ ๋ฐ์ดํฐ๋ฐ์ธ๋ฉ์ด ๋๋ฌด ํธํด์ ์์ผ๋ก๋ ๋ฌ๋ ฅ๋ง๋ค๋ ์ญ ์ฐ๊ณ ์ถ๋ค. ๋ค๋ง JsRender๊ฐ ์
๋ฐ์ดํธ๊ฐ ํ๋ฐํ๊ฒ ๋๊ณ ์์ง์์ jsp๋ง๊ณ Vue.js, React, Angular์ ๊ฐ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฐ ํ๋ ์์ํฌ๋ฅผ ๋ค๋ฃจ๊ณ ์ถ๋ค.</li></ul></li><li><code>jQuery ๋น์ค์ ์ค์ด๊ณ ๋ฐ๋๋ผJS ์ฌ์ฉ</code><ul><li>์๋ํฅ์์ ์ํด jQuery ์ฌ์ฉ์ ์ค์ด๊ณ ๋ฐ๋๋ผJS๋ฅผ ์ผ๋ถ๋ฌ ์ฌ์ฉํ๋ค. ๋ฐ๋๋ผJS๋ ์ ์ด์ฟผ๋ฆฌ๋ณด๋ค ์ฝ๋๋ ๊ธธ์ด์ง์ง๋ง ์ ์ด์ฟผ๋ฆฌAPI๋ฅผ ๋ค๋
์ค์ง์์๋ ๋๊ธฐ์ ์๋๊ฐ ๋น ๋ฅด๋ค. ์ด๋ฏธ ์์ ์ต์ด๋ฒ๋ฆฐ jQuery๋ฅผ ์์์ ์ผ๋ก ๋ฐ๋๋ผJS๋ฅผ ์ฌ์ฉํ๋ ค๋ ์ค๊ฐ์ค๊ฐ์ ์ฝ๋ ๊ฒ์์ด ํ์ํด์ ์ฒ์์๋ ์๊ฐ์ด ๊ฑธ๋ ธ์ง๋ง ํ๋ก์ ํธ ํ๋ฐ์ ๊ฐ์๋ก ์ฝ๋ฉ์๋๊ฐ ๋ถ์๋ค. ์์ผ๋ก๋ ๋ฐ๋๋ผJS๋ฅผ ์์์ ์ผ๋ก ์ฌ์ฉํด์ผ๊ฒ ๋ค. </li></ul></li><li><code>Mybatis์์ resultMap ์ฌ์ฉ</code><ul><li>Mybatis์์ ๊ฐ์ฒด์์ ๊ฐ์ฒด๋ฅผ ๋งคํํ๊ธฐ ์ํด resultMap๋ฅผ ์ฌ์ฉํ์ฌ ์ ์ฐํ ๋งตํ์ด ๊ฐ๋ฅํ๋๋ก ๊ตฌํํ์ผ๋ฉฐ ์ฝ๋์ฌ์ฌ์ฉ๊ณผ ์ ์ง๋ณด์์ ๋๋ฒ๊น
์ด ํธํ๋๋ก ์์ฑํ๋ค. ์ฌ์ค resultMap์ด ์ต์ํ์ง ์์์ resultType์ dto ๋ง์ถฐ์ ์ฌ์ฉํ ๊นํ๋ค๊ฐ resultMap๋ ์ต์ํด์ง์์๋๋ก ์ค๋ฌด์ ์จ๋ณด์!๋ผ๊ณ ํ๋จํ๊ณ ๊ฒฐ๊ณผ์ ์ผ๋ก resultMap์ ์ค๋ฌด์์ ํ ๋ฒ ์จ๋ณด๊ณ ๋๋ ์์ ๊ฐ์ด ์๊ฒผ๊ณ ๋ค์์๋ ์ธ์ ๋ ์ง ์ฌ์ฉํ ์ ์๊ฒ ๋์๋ค.</li></ul></li><li><code>observer</code><ul><li>๋์ ์นํ์ด์ง์์ ๋น๋๊ธฐ์ ์ธ DOM์กฐ์์ ์ก๊ธฐ ์ํด์ Mutation Observer๋ฅผ ์ด์ฉํ๋ค. ์ด๋ฅผ ์ํด ํ์ด์ง๋ผ์ดํ์ฌ์ดํด์ ์ถ๊ฐ๋ก ๊ณต๋ถํ๋ค. DOM์ ๋ํด์ ๋ ๊ณต๋ถ๊ฐ ํ์ํ๋ค.</li></ul></li><li><code>์ธ๋ถAPI์ฐ๋์ ์ํ RestTemplate ํ์ฉ</code><ul><li>์ง๋ ํ๋ก์ ํธ์์ ์ง๋ํ๊ฒ ๊ณต๋ถํ๋ RestTemplate์ ํ์ฉํ์ฌ ์ฝ๊ฒ ์ธ๋ถAPI์ธ ๋ฌธ์์ ์ก ์๋น์ค๋ฅผ ๊ตฌํํ๋ค.</li></ul></li></ol><p><br><br><br></p><h1 id="Problem"><a href="#Problem" class="headerlink" title="Problem"></a>Problem</h1><p>๊ฐ์ ์ด ํ์ํ๋ค๊ณ ์๊ฐ๋๋ ๋ถ๋ถ</p><ol><li><code>๋คํธ์ํฌ ์ง์</code></li><li><code>ํตํฉ์์ฝ ์ค๊ณ์ ๊ฒ๋จน์ ์ </code></li><li><code>DOM</code></li></ol><p><br><br><br></p><h1 id="Try"><a href="#Try" class="headerlink" title="Try"></a>Try</h1><p>Problem์ ํด๊ฒฐ์ฑ
์ด ๋ ์ ์๋ ๋ถ๋ถ</p><ol><li>๋คํธ์ํฌ ๊ณต๋ถ๋ฅผ ํ๋ฉด์ ๊ฒธ์ฌ๊ฒธ์ฌ ๋คํธ์ํฌ ๊ด๋ฆฌ์ฌ2๊ธ๊ณผ ๋ฆฌ๋
์ค๋ง์คํฐ ์๊ฒฉ์ฆ์ ์ทจ๋ํ ๊ฒ์ด๋ค. <ul><li>ONE ACTION: 24๋
์ 01ํ ํ๊ธฐ 2024-02-25, ์ค๊ธฐ 2024-03-31 ์ต์ข
ํฉ๊ฒฉ๋ฐํ 2024-04-09</li></ul></li><li>์ค๊ณ๋ ๊ฒฝํ์ด ์ ์ผ ์ค์ํ๋ค๊ณ ์๊ฐํ๋๋ฐ ๊ฒฝํ์ด ์๊ธฐ์ ์ง๋ ๊ฒ๋จน๊ณ ์๋ค. ๊ฒฝํ์ ๋๋ฆฌ๋ ๋ฐฉ๋ฒ์ ๊ณ ๋ฏผํด๋ดค๋๋ฐ ์ฌ์ด๋ํ๋ก์ ํธ์ ์ฑ
์ด๋ผ๊ณ ์๊ฐํ๋ค. ๋ฐ๋ผ์ ์ฌํด ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ค๊ณ ์ฑ
์๋ฐ๊ธฐ์ 1๊ถ์ ์ฝ๊ณ ํ๊ธฐ๊ธ์ ์์ฑํด์ผ๊ฒ ๋ค. ํ๋ฐ๊ธฐ๋ <a href="https://www.yes24.com/Product/Goods/69775589">ํ์์ค๋ธ๋ฐ์ดํฐ๋ฒ ์ด์ค</a>, <a href="https://www.yes24.com/Product/goods/12191214?art_bl=7769257">๊ฐ์ฅ ์ฌ์ด ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ค๊ณ ์ฑ
</a> ์ค ๊ณ ๋ฏผํด๋ณด๊ณ ์ฝ์ ๊ฒ<ul><li>ONE ACTION: ๊ทธ๋ฆผ์ผ๋ก ๊ณต๋ถํ๋ TCP/IP๊ตฌ์กฐ </li></ul></li><li>DOM ๋ฌธ์๊ฐ์ฒด๋ชจ๋ธ ํฌ์คํ
1๊ฑด์ด์ ํ๊ธฐ<ul><li>ONE ACTION: <a href="https://bitsofco.de/what-exactly-is-the-dom/">What, exactly, is the DOM?</a> ๋ฒ์ญ ํฌ์คํ
, <a href="https://javascript.info/dom-nodes">DOM tree</a> ๋ฒ์ญ ํฌ์คํ
</li></ul></li></ol><p><br><br><br></p><h1 id="๊ด๋ จ-ํฌ์คํ
"><a href="#๊ด๋ จ-ํฌ์คํ
" class="headerlink" title="๊ด๋ จ ํฌ์คํ
"></a>๊ด๋ จ ํฌ์คํ
</h1><ul><li><a href="https://sowon-dev.github.io/2023/09/10/230911ajax-sucess-error/">๋ถ๋ช
success์ธ๋ฐ ์ ๊ณ์ error๋ก ๊ฐ๋๊ฑธ๊น?</a></li><li><a href="https://sowon-dev.github.io/2023/10/15/231016imgtag-onerrer/">IMGํ๊ทธ ๊ธฐ๋ณธ์ด๋ฏธ์ง์ค์ (DEFAULT IMG, ONERROR์์ฑ) ์๋ฌ ํด๊ฒฐ</a></li><li><a href="https://sowon-dev.github.io/2023/10/17/231018momentjs-issame/">isSame ์ค๋๋ ์ง์ ๋น๊ต๊ฐ ์๋๋ ์ด์ </a></li><li><a href="https://sowon-dev.github.io/2023/10/18/231019momentjs-to-localdatetime/">moment String์ Controller์์ LocalDateTime์ผ๋ก ๋ฐ๊ธฐ</a></li><li><a href="https://sowon-dev.github.io/2023/10/19/231020URLsearchparams/">URL ํ๋ผ๋ฏธํฐ(์ฟผ๋ฆฌํ๋ผ๋ฏธํฐQuery Parameter)๊ฐ์ ธ์ค๊ธฐ</a></li><li><a href="https://sowon-dev.github.io/2023/11/14/231114mybatis-if-update-all/">mybatis update์ ๋ชจ๋ if test๋ฅผ ์จ์ผ ํ ๊ฒฝ์ฐ</a> </li><li><a href="https://sowon-dev.github.io/2023/11/14/231114mybatis-resultMap-manyassociation/">mybatis ๊ฐ์ฒด ์์ ๊ฐ์ฒด ๋งคํํ๊ธฐ</a></li><li><a href="https://sowon-dev.github.io/2023/11/14/231115lable-for/">radio/checkbox ํด๋ฆญ ์ ๋๋ ์ค๋ฅ๊ฐ label for ๋๋ฌธ์ด๋ผ๊ณ ?</a></li><li><a href="https://sowon-dev.github.io/2023/11/20/231121js-observer/">observer ์ฌ์ฉํ๊ธฐ</a></li><li><a href="https://sowon-dev.github.io/2024/01/01/240102byte-check/">๊ธ์จ์ธ๋๋ง๋ค ๋ฐ์ดํธ ๊ณ์ฐํ๊ธฐ</a></li><li><a href="https://sowon-dev.github.io/2024/01/07/240108jsp-el-queryparam/">URL ํ๋ผ๋ฏธํฐ(์ฟผ๋ฆฌํ๋ผ๋ฏธํฐQuery Parameter)๊ฐ์ ธ์ค๊ธฐ(ft.ELํํ์)</a></li><li><a href="https://sowon-dev.github.io/2024/01/08/240109domcontentloaded-vs-onload/">DOMContentLoaded์ window.onload์ฐจ์ด(ft.ํ์ด์ง ๋ผ์ดํ์ฌ์ดํดPage Lifecycle)</a></li></ul>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/Journal/">Journal</category>
<category domain="https://sowon-dev.github.io/categories/Journal/%ED%9A%8C%EA%B3%A0%EB%A1%9D/">ํ๊ณ ๋ก</category>
<category domain="https://sowon-dev.github.io/tags/%ED%9A%8C%EA%B3%A0%EB%A1%9D/">ํ๊ณ ๋ก</category>
<comments>https://sowon-dev.github.io/2024/01/10/240111prjtreview10/#disqus_thread</comments>
</item>
<item>
<title>[JS] DOMContentLoaded์ window.onload์ฐจ์ด(ft.ํ์ด์ง ๋ผ์ดํ์ฌ์ดํดPage Lifecycle)</title>
<link>https://sowon-dev.github.io/2024/01/08/240109domcontentloaded-vs-onload/</link>
<guid>https://sowon-dev.github.io/2024/01/08/240109domcontentloaded-vs-onload/</guid>
<pubDate>Mon, 08 Jan 2024 19:56:23 GMT</pubDate>
<description><p>ํ๋ฉด์์
์ ํ๋ฉด์ ํ์ด์ง๋ก๋๊ฐ ๋ค ๋ ํ ํด๋ฆญ์ด๋ฒคํธ๋ฅผ ์คํํ๊ณ ์ถ์๋ค.</p></description>
<content:encoded><![CDATA[<p>ํ๋ฉด์์
์ ํ๋ฉด์ ํ์ด์ง๋ก๋๊ฐ ๋ค ๋ ํ ํด๋ฆญ์ด๋ฒคํธ๋ฅผ ์คํํ๊ณ ์ถ์๋ค.</p><a id="more"></a><p>DOMContentLoaded๋ฅผ ์ฐ๋ค๊ฐ window.onload์๋ ๋ญ๊ฐ ๋ค๋ฅธ์ง ๊ถ๊ธํด์ ์ฐพ์๋ณด๊ฒ๋์๋ค.</p><h1 id="โ๏ธ-DOMContentLoaded์-window-onload-์ฐจ์ด"><a href="#โ๏ธ-DOMContentLoaded์-window-onload-์ฐจ์ด" class="headerlink" title="โ๏ธ DOMContentLoaded์ window.onload ์ฐจ์ด"></a>โ๏ธ DOMContentLoaded์ window.onload ์ฐจ์ด</h1><p>window.onload์ DOMContentLoaded ์ด๋ฒคํธ๋ ํ์ด์ง ๋ผ์ดํ์ฌ์ดํด๊ณผ ๊ด๋ จ์ด ์๊ณ ์ฐจ์ด์ ์ด ์กด์ฌํ๋ค.</p><p><br><br><br></p><h2 id="1-window-onload-์ด๋ฒคํธ"><a href="#1-window-onload-์ด๋ฒคํธ" class="headerlink" title="1. window.onload ์ด๋ฒคํธ"></a>1. window.onload ์ด๋ฒคํธ</h2><p>ํ์ด์ง์ ์๋ ๋ชจ๋ ์์, ์ด๋ฏธ์ง์ ์คํฌ๋ฆฝํธ๋ฅผ ํฌํจํ์ฌ ๋ชจ๋ ๋ก๋๋์์ ๋ ๋ฐ์ํ๋ค.<br>์ ์ฒด ํ์ด์ง๊ฐ ์์ ํ ๋ก๋๋ ํ์ ์ ๊ณต๋ ํจ์๊ฐ ์คํ๋๋ค.</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">window</span>.onload = <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</span><br><span class="line"> <span class="comment">// ์ฌ๊ธฐ์ ์ฝ๋ ์์ฑ</span></span><br><span class="line">};</span><br></pre></td></tr></table></figure><p><br><br><br></p><h2 id="2-DOMContentLoaded-์ด๋ฒคํธ"><a href="#2-DOMContentLoaded-์ด๋ฒคํธ" class="headerlink" title="2. DOMContentLoaded ์ด๋ฒคํธ"></a>2. DOMContentLoaded ์ด๋ฒคํธ</h2><p>HTML ๋ฌธ์๊ฐ ์์ ํ ๋ก๋๋๊ณ ํ์ฑ๋ ํ์ ๋ฐ์ํ๋ฉฐ ์คํ์ผ์ํธ, ์ด๋ฏธ์ง, ์๋ธํ๋ ์์ ๋ก๋๋ฅผ ๊ธฐ๋ค๋ฆฌ์ง ์๋๋ค.<br>DOM์ ์กฐ์ํ๊ฑฐ๋ ์ํธ์์ฉํ๋ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ๊ณ ์ ํ ๋ ์ฃผ๋ก ์ฌ์ฉ๋๋ฉฐ, window.onload๋ณด๋ค ๋น ๋ฅธ ์์ ์ ๋ฐ์ํ๋ค.</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">document</span>.addEventListener(<span class="string">'DOMContentLoaded'</span>, <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</span><br><span class="line"> <span class="comment">// DOM์ด ์ค๋น๋๋ฉด ์คํํ ์ฝ๋</span></span><br><span class="line">});</span><br></pre></td></tr></table></figure><p>๋๋ถ๋ถ์ ๊ฒฝ์ฐ์๋ DOMContentLoaded๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข๋ค.<br>์ธ๋ถ ์์์ด ๋ชจ๋ ๋ก๋๋๊ธฐ๋ฅผ ๊ธฐ๋ค๋ฆฌ์ง ์๊ณ ์ต๋ํ ๋นจ๋ฆฌ JavaScript๋ฅผ ์คํํ ์ ์์ด ์ฌ์ฉ์๊ฐ ๊ธฐ๋ค๋ฆฌ์ง์๊ณ ๋น ๋ฅด๊ฒ ํ์ด์ง๋ฅผ ์ ๊ณตํ ์ ์๊ธฐ ๋๋ฌธ์ด๋ค.<br>๋ง์ฝ ๋ชจ๋ ์ธ๋ถ ์์์ ๋ก๋๋ฅผ ๊ธฐ๋ค๋ ค์ผ ํ๋ ํน๋ณํ ์ํฉ์ด ์๋ค๋ฉด window.onload์ ์ฌ์ฉํ ์ ์๊ฒ ์ง๋ง, ๋๋ถ๋ถ์ ๊ฐ๋ฐ์์๋ ์ฃผ๋ก DOMContentLoaded๋ฅผ ๋ ๋ง์ด ์ฌ์ฉํ๋ค.</p><p><br><br><br></p><h1 id="โ๏ธ-DOMContentLoaded์-ready-์ฐจ์ด"><a href="#โ๏ธ-DOMContentLoaded์-ready-์ฐจ์ด" class="headerlink" title="โ๏ธ DOMContentLoaded์ ready ์ฐจ์ด"></a>โ๏ธ DOMContentLoaded์ ready ์ฐจ์ด</h1><p>๋ ์ด๋ฒคํธ๋ ๋์ผํ ๋ชฉ์ ์ด๋ค.<br>๋ ๋ค DOM์ด ์์ ํ ๋ก๋๋๊ณ ์คํฌ๋ฆฝํธ ์คํํ ๊ฐ๋ฅํ ์์ ์ ๊ฐ์งํ๋ ๊ฒ์ ๋ชฉํ๋ก ํ๋ค.<br>์ฐจ์ด์ ์ jQuery๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ์ ๋ฌด์ด๋ค.</p><p><br><br><br></p><h2 id="1-DOMContentLoaded-์ด๋ฒคํธ"><a href="#1-DOMContentLoaded-์ด๋ฒคํธ" class="headerlink" title="1. DOMContentLoaded ์ด๋ฒคํธ"></a>1. DOMContentLoaded ์ด๋ฒคํธ</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">document</span>.addEventListener(<span class="string">'DOMContentLoaded'</span>, <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</span><br><span class="line"> <span class="comment">// DOM์ด ์ค๋น๋๋ฉด ์คํํ ์ฝ๋</span></span><br><span class="line">});</span><br></pre></td></tr></table></figure><p>์ด๋ฒคํธ ๋ฆฌ์ค๋๋ฅผ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ pure JS(Vanilla JS)๋ฅผ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ด๋ค.<br>์ด๋ฒคํธ ๋ฆฌ์ค๋๋ฅผ ํตํด DOMContentLoaded ์ด๋ฒคํธ๋ฅผ ๊ฐ์งํ๊ณ ๊ทธ ๋ ์คํํ ์ฝ๋๋ฅผ ์ ์ํ๋ค.<br>์ด๋ฒคํธ ๋ฆฌ์ค๋๋ ์ฌ๋ฌ ๊ฐ ๋ฑ๋ก ๊ฐ๋ฅํ๋ค.</p><p><br><br><br></p><h2 id="2-jQuery-๋ผ์ด๋ธ๋ฌ๋ฆฌ-์ฌ์ฉ"><a href="#2-jQuery-๋ผ์ด๋ธ๋ฌ๋ฆฌ-์ฌ์ฉ" class="headerlink" title="2. jQuery ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ"></a>2. jQuery ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉ</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="built_in">document</span>).ready(<span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</span><br><span class="line"> <span class="comment">// DOM์ด ์ค๋น๋๋ฉด ์คํํ ์ฝ๋</span></span><br><span class="line">});</span><br></pre></td></tr></table></figure><p>์ ๋ฌธ๋ฒ์ ๋ ๋จ์ถํด์ ์ฌ์ฉํ ์ ์๋ค.</p><ul><li>๋จ์ถ๋ jQuery ๋ฌธ๋ฒ<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</span><br><span class="line"> <span class="comment">// DOM์ด ์ค๋น๋๋ฉด ์คํํ ์ฝ๋</span></span><br><span class="line">});</span><br></pre></td></tr></table></figure></li></ul><p><br><br><br></p><h1 id="โ๏ธ-ํ์ด์ง-๋ผ์ดํ์ฌ์ดํด-Page-Lifecycle"><a href="#โ๏ธ-ํ์ด์ง-๋ผ์ดํ์ฌ์ดํด-Page-Lifecycle" class="headerlink" title="โ๏ธ ํ์ด์ง ๋ผ์ดํ์ฌ์ดํด(Page Lifecycle)"></a>โ๏ธ ํ์ด์ง ๋ผ์ดํ์ฌ์ดํด(Page Lifecycle)</h1><p><img src="https://developer.mozilla.org/en-US/docs/Web/Performance/Navigation_and_resource_timings/screen_shot_2019-05-03_at_1.06.27_pm.png" alt="MDN-Navigation and resource timings"></p><p>์๋ฐ์คํฌ๋ฆฝํธ์ด ํ์ด์ง ๋ผ์ดํ์ฌ์ดํด์ ์๋์ ๊ฐ๋ค</p><ol><li>๋ฌธ์ ๊ฐ์ฒด ๋ชจ๋ธ (DOM) ์์ฑ: HTML ๋ฌธ์์ ํ์ฑ์ด ๋๋๋ฉด ๋ธ๋ผ์ฐ์ ๋ DOM์ ์์ฑ</li><li>DOMContentLoaded: HTML ์ ์ฒด๊ฐ ๋ก๋๋๊ณ DOMํธ๋ฆฌ๊ฐ ์์ฑ๋์์ง๋ง ์ด๋ฏธ์ง, stylesheets๋ฑ์ ์ธ๋ถ๋ฆฌ์์ค๋ ์์ง ๋ก๋๋์ง ์์ ์ํ</li><li>์ด๋ฏธ์ง, stylesheets๋ฑ์ ์ธ๋ถ๋ฆฌ์์ค ์
๋ก๋</li><li>load: HTML๋ฟ๋ง ์๋๋ผ ์ด๋ฏธ์ง, stylesheets๋ฑ์ ์ธ๋ถ๋ฆฌ์์ค๊น์ง ๋ก๋๊ฐ ์๋ฃ๋ ์ํ</li><li>beforeunload: ์ฌ์ฉ์๊ฐ ํ์ด์ง๋ฅผ ๋ ๋๋ ค ํ๋ ์ํ<ol><li>ํ์ด์ง๋ฅผ ๋ ๋ ๋ ์ฌ์ฉ์์๊ฒ ํ์ธ ๋ฉ์์ง๋ฅผ ํ์ํ ์ ์๋ ๊ธฐํ๋ฅผ ์ ๊ณตํ๋ค</li></ol></li><li>unload: ํ์ด์ง๊ฐ ์์ ํ ๋ก๋ฉ๋ ํ ์ฌ์ฉ์๊ฐ ๋ธ๋ผ์ฐ์ ์์ ํ์ด์ง๋ฅผ ๋๊ฐ ์ํ<ol><li>์ฃผ๋ก ์ฌ์ฉ์๊ฐ ํ์ด์ง๋ฅผ ๋ซ๊ฑฐ๋ ์๋ก๊ณ ์นจํ ๋ ์คํ๋๋ ์ฝ๋์ ์ฌ์ฉํ๋ค.</li></ol></li></ol><p>๊ฐ๊ฐ ์์๋ฅผ ๋ณด์</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 1. DOMContentLoaded ์ด๋ฒคํธ</span></span><br><span class="line"><span class="built_in">document</span>.addEventListener(<span class="string">'DOMContentLoaded'</span>, <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</span><br><span class="line"> <span class="comment">// DOM์ด ์ค๋น๋๋ฉด ์คํํ ์ฝ๋</span></span><br><span class="line">});</span><br><span class="line"></span><br><span class="line"><span class="comment">// 2. load ์ด๋ฒคํธ</span></span><br><span class="line"><span class="built_in">window</span>.onload = <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</span><br><span class="line"> <span class="comment">// ์ด๋ฏธ์ง, ์คํฌ๋ฆฝํธ๊น์ง ์ค๋น๋๋ฉด ์คํํ ์ฝ๋</span></span><br><span class="line">};</span><br><span class="line"></span><br><span class="line"><span class="comment">// 3. beforeunload</span></span><br><span class="line"><span class="built_in">window</span>.addEventListener(<span class="string">'beforeunload'</span>, <span class="function"><span class="keyword">function</span> (<span class="params">event</span>) </span>{</span><br><span class="line"> <span class="comment">// ํ์ธ ๋ฉ์์ง๋ฅผ ์ฌ์ฉ์์๊ฒ ํ์ํ ์ ์๋ ๊ธฐํ</span></span><br><span class="line"> <span class="keyword">const</span> confirmationMessage = <span class="string">'์ ๋ง๋ก ๋ ๋์๊ฒ ์ต๋๊น?'</span>;</span><br><span class="line"> event.returnValue = confirmationMessage; <span class="comment">// Standard for most browsers</span></span><br><span class="line"> <span class="keyword">return</span> confirmationMessage; <span class="comment">// For some older browsers</span></span><br><span class="line">});</span><br><span class="line"></span><br><span class="line"><span class="comment">// 4. unload</span></span><br><span class="line"><span class="built_in">window</span>.addEventListener(<span class="string">'unload'</span>, <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{</span><br><span class="line"> <span class="comment">// ํ์ด์ง๊ฐ ์์ ํ ๋ก๋ฉ๋ ํ์ ์คํ๋๋ ์ฝ๋</span></span><br><span class="line">});</span><br></pre></td></tr></table></figure><p><br><br><br></p><h1 id="์ฐธ๊ณ "><a href="#์ฐธ๊ณ " class="headerlink" title="์ฐธ๊ณ "></a>์ฐธ๊ณ </h1><ul><li><a href="https://javascript.info/onload-ondomcontentloaded">๋ชจ๋์๋ฐ์คํฌ๋ฆฝํธ-onload</a></li></ul>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/JavaScript/">JavaScript</category>
<comments>https://sowon-dev.github.io/2024/01/08/240109domcontentloaded-vs-onload/#disqus_thread</comments>
</item>
<item>
<title>[JS] URL ํ๋ผ๋ฏธํฐ(์ฟผ๋ฆฌํ๋ผ๋ฏธํฐQuery Parameter)๊ฐ์ ธ์ค๊ธฐ(ft.ELํํ์)</title>
<link>https://sowon-dev.github.io/2024/01/07/240108jsp-el-queryparam/</link>
<guid>https://sowon-dev.github.io/2024/01/07/240108jsp-el-queryparam/</guid>
<pubDate>Sun, 07 Jan 2024 17:20:47 GMT</pubDate>
<description><p>์ ๋ง ์ด๊ฐ๋จํ Query Parameter ๊ฐ์ ธ์ค๋ ๋ฐฉ๋ฒ์ param ๊ฐ์ฒด๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด๋ค.</p></description>
<content:encoded><![CDATA[<p>์ ๋ง ์ด๊ฐ๋จํ Query Parameter ๊ฐ์ ธ์ค๋ ๋ฐฉ๋ฒ์ param ๊ฐ์ฒด๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด๋ค.</p><a id="more"></a><p>๋ค์ด๋ฒ ๊ฒ์์ ์๋ก ๋ค์ด๋ณด์.<br>์๋์ ๊ฐ์ URL์์ <code>query=๊ฐ๋๋ค</code>๋ง ๊ฐ์ ธ์ค๊ณ ์ถ๋ค๋ฉด ์ด๋ป๊ฒ ํด์ผํ ๊น?</p><figure class="highlight console"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://search.naver.com/search.naver?where=nexearch&sm=top_hty&fbm=0&ie=utf8&query=๊ฐ๋๋ค</span><br></pre></td></tr></table></figure><p><br><br><br></p><h1 id="1-ELํํ์-์ฌ์ฉ"><a href="#1-ELํํ์-์ฌ์ฉ" class="headerlink" title="1. ELํํ์ ์ฌ์ฉ!"></a>1. ELํํ์ ์ฌ์ฉ!</h1><figure class="highlight jsp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">${param.query}</span><br><span class="line"></span><br><span class="line"><span class="comment">//output : ๊ฐ๋๋ค</span></span><br></pre></td></tr></table></figure><p>ํด๊ฒฐ!</p><p><br><br><br></p><h1 id="2-request์ฌ์ฉ"><a href="#2-request์ฌ์ฉ" class="headerlink" title="2. request์ฌ์ฉ!"></a>2. request์ฌ์ฉ!</h1><figure class="highlight jsp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><%= request.getAttribute(<span class="string">"query"</span>) %></span><br><span class="line"></span><br><span class="line"><span class="comment">//output : ๊ฐ๋๋ค</span></span><br></pre></td></tr></table></figure><p>์ด ๋ฐฉ๋ฒ์ ํ์ฉํ๋ฉด String๋ฟ๋ง ์๋๋ผ ๊ฐ์ฒด๋ ๊ฐ์ ธ์ฌ ์ ์๋ค.<br>๊ฐ์ฒด ํ๋ผ๋ฏธํฐ๋ฅผ ๊ฐ์ ธ์ค๋ ๋ฐฉ๋ฒ์ ์๋ ํฌ์คํ
์ฐธ๊ณ ํ๋ฉด ๋๋ค.</p><ul><li><a href="https://sowon-dev.github.io/2020/10/12/201013spring/">์ฐธ๊ณ : ์คํ๋งSPRING์์ ํ์ด์ง์ด๋ํ๊ธฐ, ํ๋ผ๋ฏธํฐ๊ฐ์ง๊ณ ํ์ด์ง์ด๋ํ๊ธฐ</a></li></ul><p><br><br><br></p><h1 id="์ฐธ๊ณ "><a href="#์ฐธ๊ณ " class="headerlink" title="์ฐธ๊ณ "></a>์ฐธ๊ณ </h1><ul><li><a href="https://sowon-dev.github.io/2023/10/19/231020URLsearchparams/">js์์ URL ํ๋ผ๋ฏธํฐ(์ฟผ๋ฆฌํ๋ผ๋ฏธํฐQuery Parameter)๊ฐ์ ธ์ค๊ธฐ</a></li><li><a href="https://sowon-dev.github.io/2024/01/07/240108jsp-el-queryparam/">jsp์์ URL ํ๋ผ๋ฏธํฐ(์ฟผ๋ฆฌํ๋ผ๋ฏธํฐQuery Parameter)๊ฐ์ ธ์ค๊ธฐ(ft.ELํํ์)</a></li></ul>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/JSP/">JSP</category>
<comments>https://sowon-dev.github.io/2024/01/07/240108jsp-el-queryparam/#disqus_thread</comments>
</item>
<item>
<title>[JSP/JAVA]๊ธ์จ์ธ๋๋ง๋ค ๋ฐ์ดํธ ๊ณ์ฐํ๊ธฐ</title>
<link>https://sowon-dev.github.io/2024/01/01/240102byte-check/</link>
<guid>https://sowon-dev.github.io/2024/01/01/240102byte-check/</guid>
<pubDate>Mon, 01 Jan 2024 14:54:53 GMT</pubDate>
<description><p>๋ฌธ์์ ์ก ์๋น์ค๋ฅผ ๋ง๋ค๊ณ ์๋ค. ์ด๋ฒ์ ๋ง๋๋ ๋ฌธ์์ ์ก์๋น์ค๋ ๋ฐ์ดํธ ์ ํ์ด ์์ผ๋ฏ๋ก textarea์ ๊ธ์จ๋ฅผ ์
๋ ฅํ ๋๋ง๋ค ์๋์ผ๋ก byte๊ฐ ๊ณ์ฐ๋๋ฉฐ 2000๋ฐ์ดํธ๋ฅผ ๋์ง ์๊ฒ ๋ง๋ค๊ณ ์ถ์๋ค.</p></description>
<content:encoded><![CDATA[<p>๋ฌธ์์ ์ก ์๋น์ค๋ฅผ ๋ง๋ค๊ณ ์๋ค. ์ด๋ฒ์ ๋ง๋๋ ๋ฌธ์์ ์ก์๋น์ค๋ ๋ฐ์ดํธ ์ ํ์ด ์์ผ๋ฏ๋ก textarea์ ๊ธ์จ๋ฅผ ์
๋ ฅํ ๋๋ง๋ค ์๋์ผ๋ก byte๊ฐ ๊ณ์ฐ๋๋ฉฐ 2000๋ฐ์ดํธ๋ฅผ ๋์ง ์๊ฒ ๋ง๋ค๊ณ ์ถ์๋ค.</p><a id="more"></a><p><br><br><br></p><h1 id="ํ๋ฉด-jsp"><a href="#ํ๋ฉด-jsp" class="headerlink" title="ํ๋ฉด jsp"></a>ํ๋ฉด jsp</h1><p>onkeyup ์ด๋ฒคํธ๋ฅผ ํตํด์ textarea์ ๋ฌด์ธ๊ฐ๋ฅผ ๊ธฐ์
ํ๋ ์๊ฐ ๋ฐ์ดํธ ๊ณ์ฐ์ด messagebyte์ ์ค์๊ฐ์ผ๋ก ๋ณด์ฌ์ง๋ค.</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br></pre></td><td class="code"><pre><span class="line"><script type=<span class="string">"text/javascript"</span>></span><br><span class="line"><span class="keyword">let</span> pickUserList = [];</span><br><span class="line"><span class="keyword">let</span> maxByte = <span class="number">2000</span>; <span class="comment">//sms ๋ 90๋ฐ์ดํธ ์ด๋ด๋ก ์์ฑ,lms ๋ 2000๋ฐ์ดํธ</span></span><br><span class="line"><span class="keyword">let</span> totalByte = <span class="number">0</span>;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">fn_chk_byte</span>(<span class="params">obj</span>)</span>{</span><br><span class="line"> totalByte = <span class="number">0</span>;</span><br><span class="line"> <span class="keyword">let</span> message = $(obj).val();</span><br><span class="line"></span><br><span class="line"> <span class="keyword">let</span> rlen = <span class="number">0</span>;</span><br><span class="line"> <span class="keyword">let</span> one_char = <span class="string">""</span>;</span><br><span class="line"> <span class="keyword">let</span> str2 = <span class="string">""</span>;</span><br><span class="line"> </span><br><span class="line"> <span class="keyword">for</span>(<span class="keyword">let</span> i=<span class="number">0</span>; i<message.length; i++) {</span><br><span class="line"> one_char = message.charAt(i);</span><br><span class="line"> </span><br><span class="line"> <span class="keyword">if</span>(<span class="built_in">escape</span>(one_char).length > <span class="number">4</span>) {</span><br><span class="line"> totalByte += <span class="number">2</span>; <span class="comment">//ํ๊ธ2Byte</span></span><br><span class="line"> }<span class="keyword">else</span>{</span><br><span class="line"> totalByte++; <span class="comment">//์๋ฌธ ๋ฑ ๋๋จธ์ง 1Byte</span></span><br><span class="line"> }</span><br><span class="line"> </span><br><span class="line"> <span class="keyword">if</span>(totalByte <= maxByte){</span><br><span class="line"> rlen = i+<span class="number">1</span>; <span class="comment">//returnํ ๋ฌธ์์ด ๊ฐฏ์</span></span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"> </span><br><span class="line"> $(<span class="string">"#messagebyte"</span>).text(totalByte);</span><br><span class="line"> </span><br><span class="line"> <span class="keyword">if</span>(totalByte > maxByte) {</span><br><span class="line"> <span class="comment">// alert("ํ๊ธ "+(maxByte/2)+"์ / ์๋ฌธ "+maxByte+"์๋ฅผ ์ด๊ณผ ์
๋ ฅํ ์ ์์ต๋๋ค.");</span></span><br><span class="line"> toastr.error(<span class="string">"๋ฉ์ธ์ง๋ ์ต๋ "</span> + maxByte + <span class="string">"byte๋ฅผ ์ด๊ณผํ ์ ์์ต๋๋ค."</span>);</span><br><span class="line"> str2 = str.substr(<span class="number">0</span>,rlen); <span class="comment">//๋ฌธ์์ด ์๋ฅด๊ธฐ</span></span><br><span class="line"> obj.value = str2;</span><br><span class="line"> fnChkByte(obj, maxByte);</span><br><span class="line"><span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line">};</span><br><span class="line"><<span class="regexp">/script></span></span><br><span class="line"><span class="regexp"></span></span><br><span class="line"><span class="regexp"><!-- ๋ฌธ์๋ด์ฉ --></span></span><br><span class="line"><span class="regexp"><div class="row"></span></span><br><span class="line"><span class="regexp"><h4>[๋ฌธ์ ๋ด์ฉ ์์ฑ]</</span>h4></span><br><span class="line"><div <span class="class"><span class="keyword">class</span></span>=<span class="string">"col-xs-12 col-sm-12 col-md-12"</span>></span><br><span class="line"><div <span class="class"><span class="keyword">class</span></span>=<span class="string">"form-group"</span>></span><br><span class="line"><textarea id=<span class="string">"msg"</span> name=<span class="string">"msg"</span> <span class="class"><span class="keyword">class</span></span>=<span class="string">"form-control"</span> placeholder=<span class="string">"๋ฌธ์๋ด์ฉ์ ์
๋ ฅํ์ธ์. ์ต๋ 2000Byte๊น์ง ์์ฑ ๊ฐ๋ฅํ๋ฉฐ 90Byte๊ฐ ๋์ผ๋ฉด ๋จ๋ฌธ(SMS)์์ ์ฅ๋ฌธ(LMS)๋ฐ์ก์ผ๋ก ๋ณ๊ฒฝ๋ฉ๋๋ค. "</span> rows=<span class="string">"5"</span> onkeyup=<span class="string">"fn_chk_byte(this);"</span>><<span class="regexp">/textarea></span></span><br><span class="line"><span class="regexp"><span id="messagebyte">0</</span>span><span class="xml"><span class="tag"><<span class="name">span</span>></span>/ 2000 Byte<span class="tag"></<span class="name">span</span>></span></span></span><br><span class="line"><div style=<span class="string">"text-align: right;"</span>>* ์ต๋ <span class="number">2000</span>Byte๊น์ง ์์ฑ ๊ฐ๋ฅํ๋ฉฐ <span class="number">90</span>Byte๊ฐ ๋์ผ๋ฉด ๋จ๋ฌธ(SMS)์์ ์ฅ๋ฌธ(LMS)๋ฐ์ก์ผ๋ก ๋ณ๊ฒฝ๋ฉ๋๋ค.<<span class="regexp">/div></span></span><br><span class="line"><span class="regexp"></</span>div></span><br><span class="line"><<span class="regexp">/div></span></span><br><span class="line"><span class="regexp"></</span>div></span><br></pre></td></tr></table></figure><p><br><br><br></p><h1 id="์๋ฐ์ฝ๋"><a href="#์๋ฐ์ฝ๋" class="headerlink" title="์๋ฐ์ฝ๋"></a>์๋ฐ์ฝ๋</h1><p>์ปจํธ๋กค๋ฌ์์ ๋ฐ์ ๋ค ๋ฐ์ดํธ ๊ณ์ฐํ๋ ์ฝ๋๋ ์๋์ ๊ฐ๋ค.<br>ํนํ getBytes()์์ ํ๊ธ ์ธ์ฝ๋ฉ์ ์ ๋๋ก ํด์ผ์ง js์ ๋์ผํ ๋ฐ์ดํธ์๊ฐ ๊ณ์ฐ๋๋ค.</p><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">int</span> bytesLength = param.get(<span class="string">"msgCn"</span>).toString().getBytes(<span class="string">"KSC5601"</span>).length;</span><br></pre></td></tr></table></figure>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/Spring/">Spring</category>
<category domain="https://sowon-dev.github.io/tags/JAVA/">JAVA</category>
<category domain="https://sowon-dev.github.io/tags/JavaScript/">JavaScript</category>
<comments>https://sowon-dev.github.io/2024/01/01/240102byte-check/#disqus_thread</comments>
</item>
<item>
<title>[js]observer ์ฌ์ฉํ๊ธฐ</title>
<link>https://sowon-dev.github.io/2023/11/20/231121js-observer/</link>
<guid>https://sowon-dev.github.io/2023/11/20/231121js-observer/</guid>
<pubDate>Mon, 20 Nov 2023 22:45:55 GMT</pubDate>
<description><p>load ํ์ removeFile ๋ฒํผ๋ค์ click์ด๋ฒคํธ๋ฅผ ๊ฑธ๊ณ ์ถ์๋ค.</p></description>
<content:encoded><![CDATA[<p>load ํ์ removeFile ๋ฒํผ๋ค์ click์ด๋ฒคํธ๋ฅผ ๊ฑธ๊ณ ์ถ์๋ค.</p><a id="more"></a><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="built_in">window</span>).on(<span class="string">'load'</span>, <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</span><br><span class="line"><span class="keyword">let</span> removeFileButtons = <span class="built_in">document</span>.querySelectorAll(<span class="string">'[data-role="removeFile"]'</span>);</span><br><span class="line">removeFileButtons.forEach(<span class="function"><span class="keyword">function</span>(<span class="params">button</span>) </span>{</span><br><span class="line"> button.addEventListener(<span class="string">'click'</span>, <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</span><br><span class="line"> <span class="keyword">let</span> fileItem = <span class="keyword">this</span>.closest(<span class="string">'.fileItem'</span>);</span><br><span class="line"><span class="keyword">let</span> uploadFileNm = fileItem.querySelector(<span class="string">'[name="attachFileNm"]'</span>).value;</span><br><span class="line"> <span class="keyword">let</span> uploadFileKey = fileItem.querySelector(<span class="string">'[name="attachFileKey"]'</span>).value;</span><br><span class="line"> deleteFile(uploadFileKey, uploadFileNm);</span><br><span class="line"> });</span><br><span class="line">});</span><br><span class="line">})</span><br></pre></td></tr></table></figure><p>ํ์ง๋ง ์ด๋ฒคํธ๊ฐ ๊ฑธ๋ ธ๋ค ์ ๊ฑธ๋ ธ๋คํด์ ํ์ฅ๋๊ป ๋ฌธ์๋๋ฆฌ๊ณ ๋ต์ ์ป์๋ค.<br>ํ์ฌ ํ๋ก๊ทธ๋จ์์ ์ฌ์ฉํ๋ ์ปค์คํ
jsํ์ผ์ ๋น๋๊ธฐ๋ฅผ ํธ์ถํ๋๋ฐ load๊ฐ ๋์ด๋ ๋น๋๊ธฐ๋๋ฌธ์ removeFile์ด ์์ง ์์ฑ๋์ง ์์ ์ํ์์ ํด๋ฆญ์ด๋ฒคํธ๋ฅผ ์ถ๊ฐํ๋ ค๊ณ ํ๋ ์๊ธฐ๋ <code>์์์ ๋ฌธ์ </code>์๋ค.<br>์ปค์คํ
jsํ์ผ์ ์ฝ๋ฐฑํจ์๊ฐ ๋ฐ๋ก ์๊ธฐ๋๋ฌธ์(๋ ๊ฑฐ์๋ผ์ ์์ ํ ์๊ฐ ์๋คโฆ.) ๋์ ๋ณํ๋ฅผ ์ก๊ธฐ์ํด observer๋ฅผ ์ฌ์ฉํ๋ฉด ํด๊ฒฐํ ์์๋ค.</p><p><br><br><br></p><h1 id="ํด๊ฒฐ์ฝ๋"><a href="#ํด๊ฒฐ์ฝ๋" class="headerlink" title="ํด๊ฒฐ์ฝ๋"></a>ํด๊ฒฐ์ฝ๋</h1><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="built_in">document</span>).ready(<span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</span><br><span class="line"><span class="keyword">var</span> targetNode = $(<span class="string">"[data-role=fileUploader]"</span>);</span><br><span class="line"><span class="keyword">var</span> observer = <span class="keyword">new</span> MutationObserver(<span class="function"><span class="keyword">function</span>(<span class="params">mutations</span>) </span>{</span><br><span class="line"> mutations.forEach(<span class="function"><span class="keyword">function</span>(<span class="params">mutation</span>) </span>{</span><br><span class="line"> <span class="keyword">for</span>(<span class="keyword">var</span> i = <span class="number">0</span>; i < mutation.addedNodes.length; i++ ) {</span><br><span class="line"> <span class="keyword">var</span> tag = mutation.addedNodes[i];</span><br><span class="line"> $(tag).find(<span class="string">'[data-role="removeFile"]'</span>).click(<span class="function"><span class="keyword">function</span>(<span class="params">event</span>) </span>{</span><br><span class="line"> event.preventDefault()</span><br><span class="line"> <span class="keyword">let</span> fileItem = <span class="keyword">this</span>.closest(<span class="string">'.fileItem'</span>);</span><br><span class="line"><span class="keyword">let</span> uploadFileNm = fileItem.querySelector(<span class="string">'[name="attachFileNm"]'</span>).value;</span><br><span class="line"><span class="keyword">let</span> uploadFileKey = fileItem.querySelector(<span class="string">'[name="attachFileKey"]'</span>).value;</span><br><span class="line"> deleteFile(uploadFileKey, uploadFileNm);</span><br><span class="line"> });</span><br><span class="line"> }</span><br><span class="line"> });</span><br><span class="line">});</span><br><span class="line">observer.observe(targetNode[<span class="number">0</span>],{ <span class="attr">attributes</span>: <span class="literal">false</span>, <span class="attr">childList</span>: <span class="literal">true</span>, <span class="attr">subtree</span>: <span class="literal">true</span>} );</span><br><span class="line">})</span><br></pre></td></tr></table></figure><p>observer๋ฅผ ์ฌ์ฉํด์ ํด๊ฒฐ!</p><p><br><br><br></p><h1 id="์ฐธ๊ณ "><a href="#์ฐธ๊ณ " class="headerlink" title="์ฐธ๊ณ "></a>์ฐธ๊ณ </h1><ul><li>ํ์ฅ๋ ์ง์</li><li><a href="https://ko.javascript.info/mutation-observer">https://ko.javascript.info/mutation-observer</a></li></ul>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/JavaScript/">JavaScript</category>
<comments>https://sowon-dev.github.io/2023/11/20/231121js-observer/#disqus_thread</comments>
</item>
<item>
<title>[์ดํด๋ฆฝ์ค/STS] enum ์ฝ๋ ์์๊ฒ ํฌ๋งทํ
ํ๊ธฐ</title>
<link>https://sowon-dev.github.io/2023/11/15/231115java-enum-code-formatter/</link>
<guid>https://sowon-dev.github.io/2023/11/15/231115java-enum-code-formatter/</guid>
<pubDate>Wed, 15 Nov 2023 01:41:29 GMT</pubDate>
<description><p>enum์ ์ฐ๋๋ฐ ์๋ํฌ๋งทํ
์ด ๋๋ฌด ๋ชป์๊ฒจ์ ๊ฐ๋
์ฑ์ด ๋จ์ด์ก๋ค.</p></description>
<content:encoded><![CDATA[<p>enum์ ์ฐ๋๋ฐ ์๋ํฌ๋งทํ
์ด ๋๋ฌด ๋ชป์๊ฒจ์ ๊ฐ๋
์ฑ์ด ๋จ์ด์ก๋ค.</p><a id="more"></a><p>ํ์ฌ <a href="https://github.com/google/google-java-format">Google Java Style Guide</a>์ ์ฌ์ฉํ๊ณ ์๋๋ฐ ์ฌ๊ธฐ์ enum code formatting๋ง ์์ ํ๋ค.</p><h1 id="์ค์ ๋ฐฉ๋ฒ"><a href="#์ค์ ๋ฐฉ๋ฒ" class="headerlink" title="์ค์ ๋ฐฉ๋ฒ"></a>์ค์ ๋ฐฉ๋ฒ</h1><ol><li>Preferences > Java > Code Style > Formatter ์ฟจ๋ฆญ</li><li>Active profile ์ edit ํด๋ฆญ</li><li>Line Wrapping ํญ ํด๋ฆญ</li><li>๋ชฉ๋ก์์ โenumโ declaration ์ฐพ๊ธฐ</li><li>โenumโ declaration ํ์ Constants ํด๋ฆญ ํ Line wrapping policy๋ฅผ Wrap all elements, every element on a new line๋ก ๋ณ๊ฒฝ</li><li>OK ํด๋ฆญ ๋!</li></ol><ul><li>๊ฒฐ๊ณผ</li></ul><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">private</span> <span class="keyword">enum</span> Food {</span><br><span class="line">APPLE, </span><br><span class="line">BANANA, </span><br><span class="line">STRAWBERRY</span><br><span class="line">};</span><br></pre></td></tr></table></figure><p>๊ฐ๋
์ฑ๋ ์ข๊ณ ์์์ํ ์ฝ๋ ํฌ๋งทํ
์คํ์ผ์ด ์์ฑ๋๋ค!</p><p>์ฝ๋ํฌ๋งทํ
์ดํด๋ฆฝ์ค/STS ๋จ์ถํค: <code>ctrl + shift + F</code></p><p><br><br><br></p><h1 id="์ฐธ๊ณ "><a href="#์ฐธ๊ณ " class="headerlink" title="์ฐธ๊ณ "></a>์ฐธ๊ณ </h1><ul><li><a href="https://stackoverflow.com/questions/19424275/formatting-java-enums-using-one-line-for-every-enum-value-with-eclipse">Formatting Java enums using one line for every enum value with Eclipse</a></li></ul>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/Journal/">Journal</category>
<category domain="https://sowon-dev.github.io/tags/Eclipse/">Eclipse</category>
<category domain="https://sowon-dev.github.io/tags/STS/">STS</category>
<comments>https://sowon-dev.github.io/2023/11/15/231115java-enum-code-formatter/#disqus_thread</comments>
</item>
<item>
<title>[HTML] radio/checkbox ํด๋ฆญ ์ ๋๋ ์ค๋ฅ๊ฐ label for ๋๋ฌธ์ด๋ผ๊ณ ?</title>
<link>https://sowon-dev.github.io/2023/11/14/231115lable-for/</link>
<guid>https://sowon-dev.github.io/2023/11/14/231115lable-for/</guid>
<pubDate>Tue, 14 Nov 2023 16:22:56 GMT</pubDate>
<description><p>radio์ checkbox๊ฐ ํด๋ฆญ์ด ์๋๋ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ค.<br>css๋ฌธ์ ์ธ ์ค ์๊ณ ๋์์ธํ์ ๋ฌธ์ํ๋๋ฐ css๋ฌธ์ ๊ฐ ์ ํ ์์๊ณ <code>id๋ฅผ ์ถ๊ฐํ๋ฉด ๋ฉ๋๋ค~</code>ํ๋ ๋ต๋ณ์ ๋ฐ์๋ค.</p></description>
<content:encoded><![CDATA[<p>radio์ checkbox๊ฐ ํด๋ฆญ์ด ์๋๋ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ค.<br>css๋ฌธ์ ์ธ ์ค ์๊ณ ๋์์ธํ์ ๋ฌธ์ํ๋๋ฐ css๋ฌธ์ ๊ฐ ์ ํ ์์๊ณ <code>id๋ฅผ ์ถ๊ฐํ๋ฉด ๋ฉ๋๋ค~</code>ํ๋ ๋ต๋ณ์ ๋ฐ์๋ค.</p><a id="more"></a><h1 id="๋ฌธ์ ์ฝ๋"><a href="#๋ฌธ์ ์ฝ๋" class="headerlink" title="๋ฌธ์ ์ฝ๋"></a>๋ฌธ์ ์ฝ๋</h1><p>FORM์ผ๋ก ๋ฐ์ดํฐ๋ฅผ ๋๊ธธ๊ฑฐ๋๊น name๊ณผ value๋ง ์ ๊ฒฝ์จ์ ์์
ํ๋ค.</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">input</span> <span class="attr">type</span>=<span class="string">"radio"</span> <span class="attr">name</span>=<span class="string">"reply_type"</span> <span class="attr">value</span>=<span class="string">"email"</span> <span class="attr">checked</span>></span><span class="tag"><<span class="name">label</span> <span class="attr">for</span>=<span class="string">"email"</span>></span>E-mail<span class="tag"></<span class="name">label</span>></span></span><br><span class="line"><span class="tag"><<span class="name">input</span> <span class="attr">type</span>=<span class="string">"radio"</span> <span class="attr">name</span>=<span class="string">"reply_type"</span> <span class="attr">value</span>=<span class="string">"post"</span> ></span><span class="tag"><<span class="name">labelfor="post"</span>></span>์ฐํธ<span class="tag"></<span class="name">label</span>></span></span><br></pre></td></tr></table></figure><p>๊ทธ๋ฐ๋ฐ ๋ผ๋์ค๋ฒํผ์ด ํด๋ฆญ๋ ์๋๊ณ post๋ก ๋ณด๋ด๋ ๊ฐ์ด ๋์ด์ค์ง์์๋ค!<br>์ด๋๊ฐ ๋ฌธ์ ์ผ๊น?</p><p><br><br><br></p><h1 id="ํด๊ฒฐ์ฝ๋"><a href="#ํด๊ฒฐ์ฝ๋" class="headerlink" title="ํด๊ฒฐ์ฝ๋"></a>ํด๊ฒฐ์ฝ๋</h1><p>์์ธ์ <code>label for</code>์ด์๋ค.<br>์น์ ๊ทผ์ฑ์ ์ํด ๋์์ธํ์์ ์ถ๊ฐํ๋๋ฐ ๋ด๊ฐ ๋ฏธ์ฒ ํ์ธํ์ง ๋ชปํ๋ค.<br><code>label for</code>๋ฅผ ์ด๋ค๋ฉด input ์์ฑ์ id๊ฐ๊ณผ ์ผ์น ์์ผ์ค์ผํ๋ค!</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">input</span> <span class="attr">type</span>=<span class="string">"radio"</span> <span class="attr">name</span>=<span class="string">"reply_type"</span> <span class="attr">value</span>=<span class="string">"email"</span> <span class="attr">id</span>=<span class="string">"email"</span> <span class="attr">checked</span>></span><span class="tag"><<span class="name">label</span> <span class="attr">for</span>=<span class="string">"email"</span>></span>E-mail<span class="tag"></<span class="name">label</span>></span></span><br><span class="line"><span class="tag"><<span class="name">input</span> <span class="attr">type</span>=<span class="string">"radio"</span> <span class="attr">name</span>=<span class="string">"reply_type"</span> <span class="attr">value</span>=<span class="string">"post"</span> <span class="attr">id</span>=<span class="string">"post"</span> ></span><span class="tag"><<span class="name">labelfor="post"</span>></span>์ฐํธ<span class="tag"></<span class="name">label</span>></span></span><br></pre></td></tr></table></figure><p>ํด๊ฒฐ!</p><p><br><br><br></p><h1 id="๊ทธ๋ผ-checkbox์-๊ฒฝ์ฐ๋"><a href="#๊ทธ๋ผ-checkbox์-๊ฒฝ์ฐ๋" class="headerlink" title="๊ทธ๋ผ checkbox์ ๊ฒฝ์ฐ๋?"></a>๊ทธ๋ผ checkbox์ ๊ฒฝ์ฐ๋?</h1><p>checkbox๋ ์ด์ ๋์ผํ๋ค.<br>name๊ณผ value๋ฅผ ์ ๋ฃ์๋๋ฐ๋ ๋๋ฌ์ง์ง์๋๋ค๋ฉด <code>lable for</code>๊ฐ๊ณผ <code>id</code>๊ฐ์ด ์ผ์นํ๋์ง ์์ฌํด๋ณด์<br>๊ทธ๋ฆฌ๊ณ ์ฌ์ํ ์ค์ ํ์ง๋ง์!</p><p><br><br><br></p><h1 id="๊ทผ๋ฐ-label์-์-์ธ๊น"><a href="#๊ทผ๋ฐ-label์-์-์ธ๊น" class="headerlink" title="๊ทผ๋ฐ label์ ์ ์ธ๊น?"></a>๊ทผ๋ฐ label์ ์ ์ธ๊น?</h1><ol><li>input ํ๊ทธ ํ์
์ค month, number, password, radio, range๊ฐ์ ๊ฒฝ์ฐ placeholder์์ฑ์ด ์๊ธฐ์ ์ด๋ค input์ธ์ง ์ค๋ช
ํด์ค์๊ฐ ์๋ค. ๋ฐ๋ผ์ label์ ์ฌ์ฉํด์ ๋ช
์์ ์ผ๋ก ์ฉ๋๋ฅผ ๋ํ๋ด์ค์์๋ค.</li><li>์น์ ๊ทผ์ฑ์ ์ํด ํ์ํ๋ค.</li></ol><p><br><br><br></p><h1 id="์ฐธ๊ณ "><a href="#์ฐธ๊ณ " class="headerlink" title="์ฐธ๊ณ "></a>์ฐธ๊ณ </h1><ul><li><a href="https://www.tcpschool.com/html-tag-attrs/label-for">TCP SCHOOL - labelํ๊ทธ์ for ์์ฑ</a></li><li><a href="https://batcave.tistory.com/79">๊ฐ๋ฐ์์ ๋์ - labelํ๊ทธ ์ ์ธ๊น?</a></li></ul>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/HTML-CSS/">HTML&CSS</category>
<category domain="https://sowon-dev.github.io/tags/HTML-CSS/">HTML&CSS</category>
<comments>https://sowon-dev.github.io/2023/11/14/231115lable-for/#disqus_thread</comments>
</item>
<item>
<title>[mybatis] ๊ฐ์ฒด ์์ ๊ฐ์ฒด ๋งคํํ๊ธฐ</title>
<link>https://sowon-dev.github.io/2023/11/14/231114mybatis-resultMap-manyassociation/</link>
<guid>https://sowon-dev.github.io/2023/11/14/231114mybatis-resultMap-manyassociation/</guid>
<pubDate>Tue, 14 Nov 2023 01:26:31 GMT</pubDate>
<description><p>๊ฐ์ฒด๋ฅผ ํ๋๋ก ์ฌ์ฉํ๋ ๊ฒฝ์ฐ mybatis์์ <code>&lt;association&gt;</code>์ ํ์ฉํ ์ ์๋ค.</p></description>
<content:encoded><![CDATA[<p>๊ฐ์ฒด๋ฅผ ํ๋๋ก ์ฌ์ฉํ๋ ๊ฒฝ์ฐ mybatis์์ <code><association></code>์ ํ์ฉํ ์ ์๋ค.</p><a id="more"></a><h1 id="๊ฐ์ฒด"><a href="#๊ฐ์ฒด" class="headerlink" title="๊ฐ์ฒด"></a>๊ฐ์ฒด</h1><p>User๊ฐ์ฒด๋ฅผ ํ๋๋ก ์ฌ์ฉํ๋ 2๊ฐ์ ์ปฌ๋ผ์ด ์๋ Board๊ฐ์ฒด๊ฐ ์๋ค.<br>์ด๋ฅผ ํ๋์ ์ฟผ๋ฆฌ๋ก selectํด์ค๋ ค๋ฉด <code>resultMap</code>๊ณผ <code><association></code>์ ์ฌ์ฉํ๋ฉด ๋๋ค.</p><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@Data</span></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Board</span> </span>{</span><br><span class="line"><span class="keyword">private</span> <span class="keyword">int</span> idx;</span><br><span class="line"><span class="keyword">private</span> String title;</span><br><span class="line"><span class="keyword">private</span> String content;</span><br><span class="line"><span class="keyword">private</span> <span class="keyword">int</span> writerIdx;</span><br><span class="line"><span class="keyword">private</span> <span class="keyword">int</span> editorIdx;</span><br><span class="line"><span class="keyword">private</span> User writer;</span><br><span class="line"><span class="keyword">private</span> User editor;</span><br><span class="line">}</span><br></pre></td></tr></table></figure><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@Data</span></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">User</span> </span>{</span><br><span class="line"><span class="keyword">private</span> <span class="keyword">int</span> idx;</span><br><span class="line"><span class="keyword">private</span> String name;</span><br><span class="line"><span class="keyword">private</span> String mobile;</span><br><span class="line">}</span><br></pre></td></tr></table></figure><p><br><br><br></p><h1 id="์ฟผ๋ฆฌ"><a href="#์ฟผ๋ฆฌ" class="headerlink" title="์ฟผ๋ฆฌ"></a>์ฟผ๋ฆฌ</h1><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"><!-- Board ๊ฐ์ฒด ๋งคํ --></span></span><br><span class="line"><span class="tag"><<span class="name">resultMap</span> <span class="attr">id</span>=<span class="string">"boardMap"</span> <span class="attr">type</span>=<span class="string">"Board"</span>></span></span><br><span class="line"><span class="tag"><<span class="name">id</span> <span class="attr">property</span>=<span class="string">"idx"</span> <span class="attr">column</span>=<span class="string">"IDX"</span>/></span></span><br><span class="line"><span class="tag"><<span class="name">result</span> <span class="attr">property</span>=<span class="string">"title"</span> <span class="attr">column</span>=<span class="string">"TITLE"</span>/></span></span><br><span class="line"><span class="tag"><<span class="name">result</span> <span class="attr">property</span>=<span class="string">"content"</span> <span class="attr">column</span>=<span class="string">"CONTENT"</span>/></span></span><br><span class="line"><span class="comment"><!-- ์๋ userMap ์คํํด์ ๊ฐ์ ธ์ด --></span></span><br><span class="line"><span class="tag"><<span class="name">association</span> <span class="attr">property</span>=<span class="string">"writer"</span> <span class="attr">resultMap</span>=<span class="string">"userMap"</span> <span class="attr">columnPrefix</span>=<span class="string">"WRITER_"</span>></span></span><br><span class="line"><span class="tag"><<span class="name">association</span> <span class="attr">property</span>=<span class="string">"editor"</span> <span class="attr">resultMap</span>=<span class="string">"userMap"</span> <span class="attr">columnPrefix</span>=<span class="string">"EDITOR_"</span>/></span></span><br><span class="line"><span class="tag"></<span class="name">resultMap</span>></span></span><br><span class="line"></span><br><span class="line"><span class="comment"><!-- userMap ๊ฐ์ฒด ๋งคํ --></span></span><br><span class="line"><span class="tag"><<span class="name">resultMap</span> <span class="attr">id</span>=<span class="string">"userMap"</span> <span class="attr">type</span>=<span class="string">"User"</span>></span></span><br><span class="line"><span class="tag"><<span class="name">id</span> <span class="attr">property</span>=<span class="string">"idx"</span> <span class="attr">column</span>=<span class="string">"IDX"</span>/></span></span><br><span class="line"><span class="tag"><<span class="name">result</span> <span class="attr">property</span>=<span class="string">"name"</span> <span class="attr">column</span>=<span class="string">"NAME"</span>/></span></span><br><span class="line"><span class="tag"><<span class="name">result</span> <span class="attr">property</span>=<span class="string">"mobile"</span> <span class="attr">column</span>=<span class="string">"MOBILE"</span>/></span></span><br><span class="line"><span class="tag"></<span class="name">resultMap</span>></span></span><br></pre></td></tr></table></figure><p>์์ฒ๋ผ resultMap ๋งคํ์ฝ๋๋ฅผ ์์ฑํด์ฃผ๊ณ ์๋์๊ฐ์ด select๋ฌธ์ ํธ์ถํ๋ฉด ๋๋ค</p><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><select id="getBoardDetail" parameterType="int" resultMap="reportMap"></span><br><span class="line"> <span class="keyword">SELECT</span> </span><br><span class="line">b.*,</span><br><span class="line">writer.NAME <span class="keyword">AS</span> WRITER_NAME,</span><br><span class="line">writer.mobile <span class="keyword">AS</span> WRITER_MOBILE,</span><br><span class="line">editor.NAME <span class="keyword">AS</span> EDITOR_NAME,</span><br><span class="line">editor.mobile <span class="keyword">AS</span> EDITOR_MOBILE</span><br><span class="line"><span class="keyword">FROM</span> BOARD b</span><br><span class="line"><span class="keyword">JOIN</span> <span class="keyword">USER</span> writer</span><br><span class="line"><span class="keyword">ON</span> b.WRITER_IDX = writer.IDX</span><br><span class="line"><span class="keyword">JOIN</span> <span class="keyword">USER</span> editor</span><br><span class="line"><span class="keyword">ON</span> b.EDITOR_IDX = editor.IDX</span><br><span class="line"><span class="keyword">WHERE</span> <span class="number">1</span>=<span class="number">1</span></span><br><span class="line"><span class="keyword">AND</span> b.IDX = <span class="comment">#{idx}</span></span><br><span class="line"></<span class="keyword">select</span>></span><br></pre></td></tr></table></figure><p><br><br><br></p><h1 id="์ฃผ์์ "><a href="#์ฃผ์์ " class="headerlink" title="์ฃผ์์ "></a>์ฃผ์์ </h1><p>association์ resultMap๋ฅผ ๋์ผํ userMap์ผ๋ก ์ฌ์ฉํ๋ฏ๋ก <code>association์ ์์ฑ์ธ columnPrefix</code>๋ก ๊ผญ ๊ตฌ๋ถํด์ค์ผํ๋ค!<br>์ด๊ฑธ ๋ชป์ฐพ์์ ๋ช์๊ฐ์ ์ฝ์งํ๋์งโฆ ์ ๋ ์ ๋ </p>]]></content:encoded>
<category domain="https://sowon-dev.github.io/categories/Database/">Database</category>
<category domain="https://sowon-dev.github.io/categories/Database/MySQL/">MySQL</category>
<category domain="https://sowon-dev.github.io/tags/MyBatis/">MyBatis</category>
<comments>https://sowon-dev.github.io/2023/11/14/231114mybatis-resultMap-manyassociation/#disqus_thread</comments>
</item>
</channel>
</rss>