ALL 140

springboot @Scheduler 다중 서버에서 한번만 실행 : shedlock

springboot @Scheduler 이용 시, 서버가 여러개 돌아가면 각 서버마다 @Scheduler가 돌아가 중복 처리 됨. Shedlock을 사용하면 스케쥴러가 한 번만 실행 됨. pom.xml 의존성 추가 net.javacrumbs.shedlock shedlock-spring 2.2.0 net.javacrumbs.shedlock shedlock-provider-jdbc-template 2.1.0 config 추가 import net.javacrumbs.shedlock.core.LockProvider; import net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateLockProvider; import net.javacrumbs.shedlock..

skill/Java.Kotlin 2023.11.21

[Java] springframework get method request param 배열일 경우, 콤마가 배열로 나눠서 오는 경우 error

import org.springframework.beans.propertyeditors.CustomCollectionEditor; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bin..

skill/Java.Kotlin 2023.10.18

[mariadb] 컬럼 데이터에 ','를 row로 처리하기

* 컬럼 데이터에 ','를 row 컬럼로 처리하기 DB data row1 : 데이터1,데이터2,데이터3 row2 : 데이터4 row3 : 데이터5 ... (아래와 같이 표현) row1 : 데이터1 row2 : 데이터2 row3 : 데이터3 row4 : 데이터4 row5 : 데이터5 SELECT replace(SUBSTRING_INDEX(SUBSTRING_INDEX(your_column, ',', n.digit+1), ',', -1), ' ','') AS split_data FROM your_table JOIN (SELECT 0 AS digit UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3) n ON LENGTH(your_column) - LENGT..

DB/전체 2023.10.18

[Swawgger] GetMapping @RequestBody Error

Http Method : Get 으로 설정 후 Request Data를 @RequestBody로 설정하여 Json으로 처리 할 때, @Operation(summary = "목록 조회") @GetMapping (value="/list") public Object list ( @Valid @RequestBody ReqVo req) { ...... Swagger 화면 요청 시, 서버 에러 java.lang.StringIndexOutOfBoundsException: begin -1, end -1, length 329 at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319) at java.base/java.lang.String.substring(St..

skill/Java.Kotlin 2023.08.24

[Jenkins] Git 연동, FTP 연동 + 로그 확인

젠킨스 Git 연동 1. Jenkins > Dashboard > Jenkins 관리 > Security > Manage Credentials 클릭 2. (Manage Credentials) > Credentials > 목록의 Domain 클릭 > Global Credentails : [+ Add Credentials] 버튼 클릭 3. Jenkins > Dashboard > + 새로운 Item > Freestyle project 선택 4. (Freestyle project) > 소스 코드 관리 > Git 선택 Repository URL 입력, Credentials은 위의 (2.)에서 설정한 사용자 목록이 나옴, Branch 선택 5. (Freestyle project) > Build Steps > Add ..

skill/Git 2023.05.03

창종료 또는 새로고침 이벤트 : ajax 결과 전송, 부모창 결과 전송

강제 창을 닫거나 새로고침 시, 'beforeunload' 통해 처리 가능 크롬에서는 문구는 설정할 수 없으며, '취소', '나가기' 버튼 제어 안됨. window.addEventListener('beforeunload', (event) => { if(isBeforeunload) { event.preventDefault(); event.returnValue = ''; } } Sample) 본창과 팝업창이 있고, 팝업창이 강제로 닫혔을 때 본창에서 경고 알림 처리 그래서 [닫기] 이벤트 발생 시, (새로고침 포함) 창을 닫아 버리고, 본 창을 통해 경고 알림 처리 팝업창 let isForceClose = true; // 강제 닫기 체크 여부 // 창종료 또는 새로고침 이벤트 window.addEventLi..

카테고리 없음 2023.04.07