Java/Spring

Spring #4

DGeon 2023. 3. 21. 09:06
  • 생성자 주입
    • controller에서 service를 호출할때
  • Setter Injection
    • xml 방식
    • annotation 방식
  • construtor injection
  • properties
    • 개인정보나 DB정보 같은 민감한 정보들을 저장해 둔다
    • Properties properties = new Properties();
    • Key Value String 고정
    • propertices에 있는 엔터가 구분자 이다
    • 경로는 src/main/resources안에 있는 편이 좋다
    • 코딩
    • Properties properties = new Properties(); //K V String 고정 properties = System.getProperties(); properties.forEach((k, v) -> { System.out.println(k +"::" + v); });
  • List
    • ArrayList
      • Vector
  • Set
    • HashSet
  • Map
    • HashMap
      • HashTable
  • iterator