2024/08 99

[Springboot] 32. 사용자 비밀번호 암호화 처리

[Springboot] 32. 사용자 비밀번호 암호화 처리 1. SpringSecurityCrypto 의존성 추가*Spring Security Crypto란? -build.gradle 코드 수정 // 암호화 implementation 'org.springframework.security:spring-security-crypto'plugins { id 'java' id 'war' id 'org.springframework.boot' version '3.2.8' id 'io.spring.dependency-management' version '1.1.6'}group = 'com.example'version = '0.0.1-SNAPSHOT'java { toolchain { languageVersion = ..

Springboot 2024.08.13

[Springboot] 31. DB 마이그레이션 (H2->MySQL)

[Springboot] 31. DB 마이그레이션 (H2->MySQL) 1. application.yml 파일 세팅 변경server: port: 8080 #서버가 사용할 포트 번호 설정 servlet: encoding: charset: utf-8 #서블릿의 응답과 요청 인코딩을 UTF-8 로 설정 force: true # 요청과 응답에 대해 이 인코딩을 강제로 사용하도록 설정합니다. spring: mvc: view: prefix: /WEB-INF/view/ #JSP파일이 위치한 디렉토리 접두사를 설정합니다. suffix: .jsp #뷰 이름에 자동으로 추가될 파일 확장자를 설정합니다. datasource: url: jdbc:mysq..

Springboot 2024.08.13

[Springboot] 30. Intercepter 활용 (인증검사 공통 처리)

[Springboot] 30. Intercepter 활용 (인증검사 공통 처리) 1. Intercepter란?(1) Intercepter의 개념:-인터셉터는 Spring MVC의 핵심 기능 중 하나로, 웹 애플리케이션에서 공통적인 처리를 재사용할 수 있게 해주는 강력한 도구이다. (2) Intercepter의 활용 사례: (3) Intercepter의 작동 원리 (4) filter와 intercepter  2. Intercepter 사용해보기(1) Intercepter 클래스 생성하기package com.tenco.bank.handler;import org.springframework.stereotype.Component;import org.springframework.web.servlet.Handler..

Springboot 2024.08.13

[Springboot] 28. 계좌 상세 보기 기능(5단계-정답 코드)

[Springboot] 28. 계좌 상세 보기 기능(5단계-정답 코드) 1. detail.jsp (입출금 내역 jsp) 계좌 상세 보기(인증) Bank App에 오신걸 환영합니다 ${principal.username}님 계좌 계좌 번호 : ${account.number} 잔액 : 전체  입금  출금    ID 날짜 보낸 이 받은 이 입출금 금액 계좌 잔액 ${historyAccount.id} ${historyAccount.sender} ${historyAccount.receiver} ..

Springboot 2024.08.12

[Springboot] 26. 계좌 상세 보기 기능(4단계-단위별 포맷)

[Springboot] 26. 계좌 상세 보기 기능(4단계-단위별 포맷) 1. ValuFormatter.java (포맷용 클래스)*추상 클래스->  기본 추상 클래스, 메서드를 포함하는 개념이다.**추상 클래스는 new~ 하지 못하기 때문에, 상속해서 사용하는 수 밖에 없다.=> 추상 클래스=상속해서 사용하자는 의미!package com.tenco.bank.utils;import java.sql.Timestamp;import java.text.DecimalFormat;import java.text.SimpleDateFormat;// 추상 클래스public abstract class ValuesFormatter { // 시간 포맷 public String timestampToString(Timestamp..

Springboot 2024.08.12

[Springboot] 25. 계좌 상세 보기 기능(3단계-모델, 레포지토리, 쿼리문 작성)

[Springboot] 25. 계좌 상세 보기 기능(3단계-모델, 레포지토리, 쿼리문 작성)  1. historyRepository.java//코드 추가 예정 - 모델을 반드시 1:1 엔터티에 매핑을 시킬 필요는 없다. // 조인 쿼리, 서브쿼리, 동적 쿼리, type=all, de...,accountId... public List findByAccountIdAndTypeOfHistory(@Param("type") String type, @Param("accountId") Integer accountId);  2. HistoryAccount.java (HistoryAccountDTO)package com.tenco.bank.repository.model;import java.sql.Timesta..

Springboot 2024.08.12