본문 바로가기

springboot

(13)
Spring Boot로 간단한 웹 사이트 만들기 - DB 연동 목표 mariadb & mybatis 연동 1. pom.xml ... org.springframework.boot spring-boot-starter-jdbc org.mariadb.jdbc mariadb-java-client org.mybatis.spring.boot mybatis-spring-boot-starter 2.0.1 ... 2. application.yml spring : devtools : livereload : enalbed : true thymeleaf: cache : false datasource: hikari : maximum-pool-size : 4 url : jdbc:mariadb://localhost:3306/bamdule username : root password : 1234..
[Spring Boot] Spring Security 적용하기 Spring Security 란? Spring Security는 스프링 기반의 어플리케이션 보안을 담당하는 프레임워크입니다. Spring Security를 사용하면 사용자 인증, 권한, 보안처리를 간단하지만 강력하게 구현 할 수 있습니다. Spring Boot + Hibernate + SpringSecurity + thymeleaf + mariadb를 이용해 간단한 회원 가입 및 로그인 기능을 구현해보겠습니다. pom.xml ... 2.1.9.RELEASE ... org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-tomcat provided org.springframework.boot s..
[Spring Boot] Spring Security의 동작 Spring Security 란? Spring Security는 스프링 기반의 어플리케이션 보안을 담당하는 프레임워크이다. Spring Security를 사용하면 사용자 인증, 권한, 보안처리를 간단하지만 강력하게 구현 할 수 있다. Filter 기반으로 동작하기 때문에 Spring MVC와 분리되어 동작한다. Spring Security를 이해하기 위해서는 먼저 보안관련 용어를 숙지해야 한다. 접근 주체(Principal) 보안 시스템이 작동되고 있는 애플리케이션에 접근하는 유저 인증(Authentication) 접근한 유저를 식별하고, 애플리케이션에 접근할 수 있는지 검사 인가(Authorize) 인증된 유저가 애플리케이션의 기능을 이용할 수 있는지 검사 SecurityFilterChain 일반적으로..
[Spring Boot] Hibernate Open Session In View Spring Boot에서 Hibernate 테스트를 하고 있던 도중 예기치못한 상황을 마주했습니다. 영속성이 끝났다고 생각되는 시점에서 프록시 객체를 조회하면 LazyInitializationException - No Session에러가 발생해야 하는데 Select Query가 실행되는 것이었습니다. 웹 검색을 통해 다음과 같은 사실을 알았습니다. Open Session In View Transaction이 종료된 후에도 Controller의 Session이 close되지 않았기 때문에, 영속 객체는 Persistence 상태를 유지할 수 있으며, Session이 열려있고 Persistence 상태이기 때문에 프록시 객체에 대한 Lazy Loading을 수행할 수 있게 됩니다. 출처: https://ki..
[Spring Boot] Hibernate 연동 방법 1. Hibernate란 Boss에서 개발한 ORM(Object Relation Mapping)프레임워크 중 한개입니다. ORM이란 객체와 DB 테이블의 매핑을 의미합니다. ORM 매핑을 이용하면 객체로 DB 테이블 조작할 수 있습니다. 2. pom.xml ... org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-tomcat provided org.springframework.boot spring-boot-starter-data-jpa org.mariadb.jdbc mariadb-java-client ... Spring Boot 버전 - 2.1.0.RELEASE hibernate-core..

반응형