분류 전체보기 썸네일형 리스트형 Thymeleaf map Key 1 Value 1 Map의 key, value를 활용하는 반복문 //Map이 비어있지 않을 때 실행할 내용 Map에 내용이 있을때만 실행하는 분기문 Reference: http://stackoverflow.com/questions/23144358/how-to-loop-through-map-in-thymeleaf 더보기 Spring, @Component vs @Service Component vs service 스프링에서 컴포넌트 스캔 대상임을 알리기 위한 어노테이션으로 @Component, @Service, @Controller, @Repository 등을 사용한다. 이들 간의 역할은 생각보다는 별 차이가 없다. { Spring provides further stereotype annotations: @Component, @Service, and @Controller. @Component is a generic stereotype for any Spring-managed component. @Repository, @Service, and @Controller are specializations of @Component for more specific use cases, f.. 더보기 jQuery attr, prop 의 차이점 selector를 활용해 선택한 속성이나 새로 추가한 속성에 대해서 새로운 속성값을 추가할 때 .attr, .prop을 사용하게 된다. attr과 prop은 얼핏 사용하기엔 동일한 역할을 하는 듯이 보이나 실제로는 다른 부분이 있다. jquery 공식 사이트를 참고하고 내용을 다듬어보자면 1.6버전 이전엔 별다른 차이가 없었으며 1.6버전부터는 attr은 최초 선언 시 속성값을 가져오며 prop은 변경된 값을 파악하여 가져온다. prop이 attr에 비해 더 동적인 느낌이라고 보면 될 것 같다. +추가 내용 checked의 경우 attr은 checked 그 자체를 받아오는 반면 prop은 true로 받아와서 if문 등과 같이 쓰기 더 좋다 더보기 Terraform 403 error 테라폼을 진행하기 위해서 terraform init terraform plan 위 과정을 진행 중에 403 에러가 뜨는 경우가 있다. terraform은 tf파일의 profile 정보에 맞는 .aws 폴더 credentials 파일의 계정 정보를 사용하는데, 해당 사용자에 특정 인프라 생성에 관한 권한이 없는 경우에 주로 발생한다. profile의 사용자에 terraform으로 생성하기 위한 적절한 권한을 부여해주면 해결된다. 더보기 gRPC with (spring, load balancing, TLS, health check) 예제 0. gRPC base Git : https://github.com/Mussyan/grpc_handson 을 베이스로 아래 내용 중 '기존 ~ 코드'는 위 깃의 2, 3, 4번 챕터를 통해 만든 프로젝트를 뜻한다. 1. with spring Reference : https://coding-start.tistory.com/352 기존 코드에 레퍼런스를 적절히 활용하였음. build.gradle(서버, 클라이언트 공통) buildscript { repositories { mavenCentral() } dependencies { classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8' } } plugins { id 'org.springframework.boo.. 더보기 Protobuf 문법 목차 Syntax Field types Field Rules Tag Reserved Field service(rpc) style guide Syntax syntax = "proto3"; //proto3 버전 문법 사용 'syntax'는 버전을 정하는 구문이며 'proto2'와 'proto3'가 있다. 해당 내용이 없으면 'proto2'가 default값으로 적용되며 gRPC를 활용하려면 'proto3'를 사용해야 한다. proto2는 후술할 필드 규칙이 필수값이나 proto3은 그렇지않은 등 문법이 차이가 일부 있으며 요즘엔 대부분 proto3을 사용하는 추세이므로 이후 설명은 proto3를 기준으로 한다. Field types message Foo { string name = 1; //문자열 필드. i.. 더보기 [java] ExecutorService 와 Runnable, Callable을 통한 async (기초 예제 + 매우 기초 지식) 자바에서 async를 구현하는 데에는 여러 방법이 있을 것이다. 그 중 한가지 방법인 executorService와 Runnable, Callable에 대한 매우 간략한 예제와 더 간략한 설명. Runnable 혹은 Callable을 implements 하는 클래스를 생성한다. 둘의 공통점 및 차이점은 대략 아래와 같다. Runnable Callable 인자를 받아서 활용 가능 executorService와 함께 활용하여 async한 동작 구현 가능 run 메소드 override call 메소드 override run 메소드는 리턴값이 없음 call 메소드는 원하는 형태로 리턴 가능 아래는 runnable 예시. public class AsyncTest { public static class Runner.. 더보기 java 리눅스 명령어 실행하기(processBuilder) Processbuilder 자바에서 리눅스 명령어를 실행할 수 있는 메소드. 사용 예는 아래와 같다. // 명령어를 저장할 String AllayList 선언 List list = new ArrayList(); // ssh 접속 + 타임아웃, StrictHostKeyChecking 옵션 list.addAll(Arrays.asList("ssh", "-o", "ConnectTimeout="+monitoringConfig.getTimeout(), "-o", "StrictHostKeyChecking=no", user + "@" + targetIP)); // docker inspect 명령어 활용하여 pid 체크 list.addAll(Arrays.asList("docker", "inspect", "-f", "\".. 더보기 이전 1 2 3 4 5 6 다음