Java & Spring10 JSONObject로 json 생성 시 순서가 안 맞을 때 package com.ryan.practice.rest; import java.lang.reflect.Field; import java.util.LinkedHashMap; import org.json.JSONObject; import lombok.extern.slf4j.Slf4j; @Slf4j public class JSONObjectPractice { public JSONObject printJSONObject() { JSONObject jsonObject = new JSONObject(); try { Field changeMap = jsonObject.getClass().getDeclaredField("map"); changeMap.setAccessible(true); changeMap.set(jso.. 2023. 3. 9. IntelliJ 단축키 Ctrl + Shift + U 대소문자 변환 Ctrl + N 전체 클래스 검색창 띄우기 Shift + F10 Run Application Shift + F9 Debug Application Ctrl + F2 Stop Application Ctrl + Alt + O import문 정리 Alt + Insert Generate Ctrl + Alt + Left 이전 위치로 돌아가기 Ctrl + Shift + T Create Test Ctrl + Shift + Alt + L 코드 정렬 2023. 3. 9. 코딩테스트 대비 Java 기본문법 레퍼런스 Scanner next()와 nextLine() 차이 Scanner scanner = new Scanner(System.in); //input : Hello world\nThis is a test scanner.next(); // "Hello" scanner.nextLine(); // "Hello world" Scanner로 char 입력 받기 char ch = scanner.next().charAt(0); String 대소문자 변환 String str = "Hello World!"; String str1 = str.toLowerCase(); String str2 = str.toUpperCase(); char 대소문자 변환 char ch = "a" char ch1 = Character.toUpperCas.. 2023. 1. 25. Logback 설정 정리 로그 레벨 Error > Warn > Info > Debug > Trace Warn : 당장 서비스 운영에는 영향이 없지만 주의해야 할 부분 Trace : 모든 레벨에 대한 로깅이 추적되므로 개발 단계에서 사용함 별다른 설정을 하지 않을 경우, 로그 레벨의 기본 값은 Info이며, 로그 레벨의 상위 로그만 출력된다. ex) Info로 설정할 경우, Errror, Warn, Info 레벨의 로그만 출력됨 로그 설정파일 src/main/resource/logback-spring.xml에 작성한다. true utf-8 [%d{yyyy-MM-DD HH:mm:ss.SSS}][%-5level] \(%F:%L\) - %msg%n ${server.log.basedir}/gateway/gateway.log utf-8 %.. 2023. 1. 11. 이전 1 2 다음