Json Web Token
스프링 시큐리티 공부 18 - JWT (Json Web Token) (tistory.com)
JWT 자바 가이드. 이 글은 OAuth와 JSON Web Token과 같은 토큰 기반의… | by Out of Bedlam | Medium
server:
port: 8080
servlet:
context-path: /
encoding:
charset: UTF-8
enabled: true
force: true
spring:
datasource:
# h2 연결용 DB 정보
driver-class-name: org.h2.Driver # Database를 H2로 사용하겠다.
# url: jdbc:h2:~/test # H2 접속 정보
# url: jdbc:h2:tcp://localhost/~/test
username: sa
password:
# MySQL 연결용 DB 정보
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/security?serverTimezone=Asia/Seoul
# username: cos
# password: cos1234
jpa:
hibernate:
ddl-auto: create #create update none
naming:
#SpringPhysicalNamingStrategy(Default) => camel case를 underscore 형태로 변경
#PhysicalNamingStrategyStandardImpl => 변수 이름을 그대로 사용
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
show-sql: true
H2 DB로 연결 테스트
Generic H2 (Embedded)를 선택하고 JDBC URL에 jdbc:h2:~/test를 입력하고 연결을 클릭한다.
test라는 데이터베이스가 생성되며, 생성할 데이터베이스 이름을 다른걸로 하고싶으면 test 말고 다른 이름을 입력하면 된다.
다시 첫화면으로 가서
저장한 설정: Generic H2 (Server)
JDBC URL: jdbc:h2:tcp://localhost/~/test
를 입력하고 연결을 클릭한다.
데이터베이스 파일을 생성한 다음에 JDBC URL을 저렇게 변경하는 이유는 파일 직접 접근이 아닌 TCP 소켓을 통해 접속해야 어플리케이션과 콘솔이 동시에 접근했을 때 오류가 발생하지 않기 때문이다.
에러
2023-02-14 19:21:26.844 ERROR 5108 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Cannot call sendError() after the response has been committed] with root cause
'Project & Issu' 카테고리의 다른 글
좋아요 기능 동시성 처리 (0) | 2023.05.04 |
---|---|
게시판 개인 프로젝트 JPA 이슈 해결 - N+1, LazyInitializationException (0) | 2023.05.02 |
토이 프로젝트에 적용할 기능, 기술에 대한 기록 - 알림 기능, 요청에 대한 이력 적재 기능, maven -> gradle (1) | 2023.03.27 |
security (0) | 2023.01.08 |
springboot-blog (0) | 2022.12.15 |