목록분류 전체보기 (61)
개발 기록이
JPA(Java Persistence API)란?객체 지향 프로그래밍과 관계형 데이터베이스 간의 차이를 자동으로 연결해 주는 역할을 하며 다음과 같은 장점이 있다. 1. SQL 중심 -> 객체 중심 개발 JDBC API를 통해 직접 SQL 쿼리를 작성하는 경우, 프로젝트가 커지고 쿼리가 복잡해질수록 관리가 어려워질 수 있는데 JPA를 사용하면 SQL에 대한 의존도를 줄여주어, 복잡한 프로젝트에서도 객체 중심으로 효율적인 개발을 할 수 있다. 2. 생산성 증대CRUD를 간단한 메서드를 통해 사용할 수 있다.저장: jpa.persist(member)조회: Member member = jpa.find(memberId)수정: member.setName("변경할 이름")삭제: jpa.remove(member)JP..

Node랑 Element 개념이 헷갈려서 정리해보려고 한다. Node (노드) ├─ Element Node (요소 노드)- , 와 같은 HTML 태그├─ Text Node (텍스트 노드) - "Hello, World!" 등 ├─ Comment Node (주석 노드) - 등 └─ Document Node (문서 노드) - document 객체 Element(요소)는 Node(노드)의 종류 중 하나이다.즉, 노드(Node)는 DOM(Document Object Model) 트리 구조의 모든 단위를 포괄하는 개념이고, 이 중에서 HTML 태그를 나타내는 것이 요소(Element)를 나타낸다. 따라서 요소는 노드의 하위 개념이라고 이해하면 된다.노드(Node): DOM 트리의 모든 단위.요소(Element)..

1. 새로운 노드를 기존의 노드 바로 앞에 insert node.insertBefore(새로운 노드, 기존 노드) return : node object * 새로운 노드를 자식으로, 기존 노드 바로 앞에 추가함. 2. 자식 노드 삭제node.removeChild(node) return : node object 3. 노드 복제node.cloneNode(boolean) return : node object * 참고 : https://studyingbackhoe.tistory.com/60 [JavaScript] cloneNode로 HTML 요소 복제하기평소에 JavaScript로 배열에 담긴 JSON 데이터를 HTML로 뿌릴 때 innerHTML에 더하는 방식을 사용했다.data.forEach(info => {..

1. 노드 태그 이름 가져오기element.tagName return : string 2. 노드 id 속성값 접근element.id return : string 3. 노드 class 속성값 접근element.className return : string 4. 노드 속성 접근element.getAttribute(속성명) return string 5. 노드의 속성값 변경element.setAttribute(속성명, 값) return : 없음 6. 노드 속성 제거element.removeAttribute(속성명) return : 없음 7. 노드의 속성이 있는지 체크element.hasAttribute(속성명) return : boolean 8. 새로운 노드 생성document.createElement(node..

1. id 접근document.getElementById(id) return : element object* element object는 node object와 다른 유형(텍스트 노드, 주석은 element object에 포함되지 않음) 2. tag 명으로 접근document.getElementsByTageName(tagname) return : nodeList object* nodeList object는 Array와 같은 노드 목록을 의미함. 3. class 접근document.getElementsByClassName(class) return : nodeList object 4. css 기법으로 첫 번째 노드 선택document.querySelector(css selectors) return : nod..

필터는 1개 이상이 존재할 수 있으며 각각의 필터는 맡은 작업을 수행하고 작업이 다음 필터에서 수행될 수 있도록 제어권을 넘겨주면서 최종적으로 서블릿까지 도달한다. FilterChain은 요청이 여러 필터를 거쳐 최종적으로 서블릿에 도달하도록 하는 구조.각 필터는 doFilter 메서드 내에서 chain.doFilter(request, response)를 호출하여 다음 필터 또는 서블릿으로 요청 전달.필터 체인의 각 필터는 요청과 응답을 처리할 수 있으며, 필터 체인이 완료되면 서블릿이 요청을 처리.출처 : https://realrain.net/posts/spring-security-filterOpenAI ChatGPT (https://openai.com)

평소에 JavaScript로 배열에 담긴 JSON 데이터를 HTML로 뿌릴 때 innerHTML에 더하는 방식을 사용했다.data.forEach(info => { htmlList.innerHTML += ` 사용자 번호: ${info.userSeq} 이름: ${info.userName} 전화번호: ${info.tel} 부서명: ${info.deptName} `;}) 이 방식이 코드상으로는 간단히 작성할 수 있어 편리하지만 반복적으로 innerHTML을 사용하여 리스트를 가져오는 경우, 전체 구조가 다시 렌더링 되면서 성능 저하를 불러올 수 있다는 단점이 있기 때문에 cloneNode 방식을 사용해 보기로 했다. * innerHTML : 기존의..

톰캣 서버를 재기동해도 서버가 올라오지 않아 log를 확인해 보니 다음과 같은 에러가 발생했다. org.apache.catalina.startup.TldConfig execute정보: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.org.apache.catalina.startup.Ho..

현재 페이지에서 이전에 방문한 페이지의 URL을 가져오는 방법에 대해 알아보자. 첫 번째 페이지(http://localhost:8482/firstPage.do)에서 버튼을 통해 두 번째 페이지로 이동 키보드 F12를 눌러 개발자도구 열기 - [Network 탭] - [Headers] 의 Referer에 이전 페이지(http://localhost:8482/firstPage.do) URL 값이 들어있는 걸 확인할 수 있다. 이 값을 자바스크립트로 가져오기 위해서는 아래와 같은 코드를 사용하면 된다.document.referrer 두번째 페이지에 다음과 같은 스크립트를 추가하여 알럿으로 확인해볼 수 있다.alert("이전 페이지 URL은 " + document.referrer + "입니다."); HTML 삽입..

Java로 난수를 생성하는 방법이 여럿 있는데 대표적인 3가지 방식을 정리해보려고 한다. 1. Math.random() 메서드 0.0 이상 1.0 미만의 난수가 생성된다. 그러나 Math.random()은 고정된 시드를 설정할 수 없어, 동일한 난수 시퀀스를 재현하기 어렵다는 단점이 있다. import java.util.*;class Main { public static void main(String[] args) { double num1 = Math.random(); int num2 = (int)(Math.random()*100); // 0 ~ 100 사이의 난수 생성 System.out.println(num1); System.out..