전체 글 44

Spring Boot 스케줄러 @Scheduled 어노테이션 사용

※ 1분마다 실행하여 특정폴더의 1분전 화일 삭제하기 @SpringBootApplication에 @EnableScheduling 선언 @EnableScheduling @SpringBootApplication public class DevApplication { @Bean public ObjectMapper objectMapper() { ObjectMapper objectMapper = new ObjectMapper(); SimpleModule module = new SimpleModule(); objectMapper.registerModule(module); return objectMapper; } public static void main(String[] args) { SpringApplication...

Spring 2023.10.27

웹(Chrome)에서 응용 프로그램 실행 : Registry 이용한 Custom URL schemes 방식 호출

레지스트리에 Key를 등록하여 호출하는방법 Window + R : command 창을 실행하여 regedit입력 웹페이지에서 링크에 들어갈 APP명으로 키 생성 HIKEY_CLASSES_ROOT > 우클릭 > 새로만들기 > KEY (test) 생성한 KEY(test)에 문자열 등록 KEY 우클릭 > 새로 만들기 > 문자열 값 을 선택하면 "새 값 #1" 자동등록 새 값 #1을 URL protocol 으로 수정 하위 KEY 생성 KEY(test) 하위에 동일한 방법으로 shell - open- command 순으로 하위 키를 생성 KEY(command)의 (기본값) 문자열 값 수정 기본값 항목의 데이터를 "응용프로그램 절대경로" "%1" 로 수정한다. "%1" 은 응용 프로그램 실행 시 args[]에 들어..

Etc 2023.10.26

Spring Boot에서 타임리프 이미지 동적 리소스 사용하기

WebMvcConfiguration 컨트롤러에서 요청하여 웹 리소스로 한 번 더 매핑 작업 import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.CacheControl; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.spring..

Spring 2023.10.11

docker image를 tar 파일 save / load(화일 다운로드)

image 파일로 저장 docker save -o [파일명] [이미지명] [root@localhost ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE gama_ubuntu0.92 latest 0f7a3cb33d65 24 hours ago 3.8GB gama_ubuntu0.91 latest c8ebd755ddcc 5 weeks ago 2.81GB ubuntu_in_apm2 0.97 cb81eca7b3ae 5 weeks ago 18.4GB unjin_jdk7_tomcat7 0.91 dd1c53af4fac 2 months ago 3.01GB [root@localhost ~]# docker save -o test.tar gama_ubuntu0.92:latest ..

Docker 2023.10.05

Java > C# UDP 통신 / 리틀엔디안(Little Endian)방식

ByteBuffer buffer = ByteBuffer.allocate(8); // 리틀엔디안(Little Endian) 으로 변환 buffer.order(ByteOrder.LITTLE_ENDIAN); private final static String IP = "192.168.0.8"; private final static int PORT = 9050; public static void main(String[] args) throws IOException { InetAddress ia = InetAddress.getByName(IP); DatagramSocket ds = new DatagramSocket(); // Java에서 둘 이상의 바이트 배열 연결 ByteArrayOutputStream outpu..

java 2023.08.21

ByteBuffer 객체 생성 및 크기 용량 할당

putLong() / putDouble() / put() 메소드를 이용하여 ByteBuffer.allocate(8) 크기만큼 용량을 할당 public static void main(String[] args) throws UnsupportedEncodingException { // 8 -37 -103 -69 -106 -98 18 20 long str1 = 638272803167932948L; byte[] bytes1 = ByteBuffer.allocate(8).putLong(str1).array(); for (int i = 0; i < bytes1.length; i++) { System.out.println(bytes1[i]); } System.out.println("---------------------..

java 2023.08.11