2025/04 5

[Error] java.lang.IllegalStateException: Cannot call sendError() after the response has been committed

1. 순환 참조(Circular Reference) 에러 발생순환 참조는 객체 A가 객체 B를 참조하고, B가 다시 A를 참조하는 형태를 말한다. 아래의 관계를 그대로 Controller에서 JSON으로 변환하여 응답하면 [Error]  java.lang.IllegalStateException: Cannot call sendError() after the response has been committed 에러가 발생한다. 이것을 JPA 순환참조 오류라고 한다.class Parent { @OneToMany(mappedBy="child") List children;}class Child { @ManyToOne Parent parent;}2. 순환 참조 문제Parent p = new Pa..

카테고리 없음 2025.04.10

java HashMap Vs ConcurrentHashMap

java HashMap Vs ConcurrentHashMap  https://javaconceptoftheday.com/hashmap-vs-concurrenthashmap-in-java/ HashMap Vs ConcurrentHashMap In JavaDifferences between HashMap and ConcurrentHashMap in Java, HashMap Vs ConcurrentHashMap In Java, How ConcurrentHashMap differs from HashMap In Java...javaconceptoftheday.com HashMap과 ConcurrentHashMap은 둘 다 Java에서 사용되는 맵(Map) 인터페이스의 구현체입니다. 이들은 키-값(key-value..

카테고리 없음 2025.04.03

java final, static, final static

final: 값이 한 번 할당되면 변경할 수 없는 변수를 의미합니다. 선언 시 초기화해야 하며, 이후 다른 값으로 변경할 수 없습니다.final int constantValue = 10;// 다음과 같이 선언 후 값 변경 시 컴파일 오류가 발생합니다.// constantValue = 20; // 오류: cannot assign a value to final variable 'constantValue'final 메소드: 하위 클래스에서 오버라이드(재정의)할 수 없는 메소드를 의미합니다. 부모 클래스에서 final로 선언된 메소드는 하위 클래스에서 변경할 수 없습니다. class Parent { public final void display() { System.out.println("Par..

카테고리 없음 2025.04.02

IntelliJ 단축키

최근 열어본 파일 검색window: Ctrl + e파일 검색window: Shift 2번 클릭테스트 클래스 생성 단축키window: Ctrl + Shfit + TFor 문 완성window: iter iterfor (String s : beansOfType.keySet()) { } 자동완성window: Ctrl + Alt + vac.getBean("memberService", MemberService.class);//자동완성MemberService memberService1 = ac.getBean("memberService", MemberService.class);Statc import 자동 단축키window: alt + enterimport static org.assertj.core.api.Asserti..

카테고리 없음 2025.04.01