SpringBoot 96

Springboot Security 2.7.+ 에서 authenticationManagerBean

이전글 https://cordingmonster.tistory.com/252 2.7. + 버전에서 시큐리티 사용하기 최근 새프로제그를 만들고 WebSecurityConfigurerAdapter가 디클라인이 된걸 확인 하였다 https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter In Spring Security 5.7.. cordingmonster.tistory.com AuthenticationManager bean등록 방식도 바뀌었다 https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter S..

Springboot/Security 2022.07.07

Springboot Security 2.7. + 버전 WebSecurityConfigurerAdapter

최근 새프로제그를 만들고 WebSecurityConfigurerAdapter가 디클라인이 된걸 확인 하였다 https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter Spring Security without the WebSecurityConfigurerAdapter In Spring Security 5.7.0-M2 we deprecated the WebSecurityConfigurerAdapter, as we encourage users to move towards a component-based security configuration. SecurityFilterChain 리턴해주는 bean을 등록..

Springboot/Security 2022.07.07

@oneToMany foreign key constraint fails 해결하기

1번 - @oneToMany일경우 나의 값을 적어줘야한다 @manyToOne일경우 같이 가져올 테이블 값을 지정해야한다 일단 테이블을 보자 a테이블은 글/b테이블은 댓글테이블이다 난 이전에 저 oneToMant에 a_id가 아닌 b_id를 적어 놓았다 그래서 foreign key constraint fails 에러를 만났다 사소하지만 은근히 헷갈릴거 같아서 적어 놓는다 아래글을 보고 해결한것이다 https://reddit.fun/82784/onetomany-cannot-add-update-child-foreign-constraint-fails?show=82806 OneToMany: Cannot add or update a child row: a foreign key constraint fails - Q&..

Springboot/Jpa 2022.04.04

jpa 지연로딩을 사용하자

사용법 1.oneToMany든 manyToOne이든 fetch = FetchType.LAZY를 붙혀준다 2.jpa could not initialize proxy - no session 오류발생시 참고 https://cordingmonster.tistory.com/235 jpa lazy사용시 jpa could not initialize proxy - no session 에러 두가지 방법이 있다 1.해당 함수 위에 @Transactional추가 -https://jforj.tistory.com/98 [JPA] could not initialize proxy - no Session 에러 안녕하세요. J4J입니다. JPA를 사용하다가 연관관계 매핑을 위해 @.. cordingmonster.tistory.com ..

Springboot/Jpa 2022.04.04

vscode에서 Jpa와 query dsl Qclass만들기

일단 이글을 보고 셋팅한다 https://www.inflearn.com/questions/355723 compileQuerydsl 오류 - 인프런 | 질문 & 답변 학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼 www.inflearn.com buildscript { ext { queryDslVersion = "5.0.0" } } plugins { id 'org.springframework.boot' version '2.6.0' id 'io.spring.dependency-management' version '1.0.11.RELEASE' //querydsl 추..

Springboot/Jpa 2022.04.03

Springboot WebSocketSession에서 파라미터 꺼내기

uri->쿼리꺼내기->&기준으로 파라미터이름,값을가져오면된다 uri꺼내기/쿼리꺼내기 WebSocketSession가 들고 있는 기능이있다 geturi=uri객체를 주는데 uri객체안에 getquery를하면 ?~물음표뒤에 쿼리들을 얻을 수 있다 그리고 https://blog.naver.com/PostView.nhn?blogId=kkson50&logNo=221425190633&categoryNo=33&parentCategoryNo=0&viewDate=&currentPage=1&postListTopCurrentPage=1&from=search [Java] 웹주소 URL 파라미터 파싱하기 (구문분석) 샘플 웹주소에서 넘오는 여러개의 파라미터를 손쉽게 파싱하는 샘플코드입니다. 구문분석보다는 파싱(parsing)이..

Springboot 예외처리하기

이전까지는 try catch로 했었다 하지만 결제 시스템을 만들기 시작하면서 좀 더 좋은 예외처리가 필요했고 앞으로 try catch보다는 이 방법을 더 많이 사용할 거 같다 이전에도 본 방법이지만 귀찮아서 그리고 토이 프로젝트이니 그때그때 예외를 막았다 커스텀 예외 생성 RestControllerAdvice에 추가 이렇게 쓰면 지저분한 try catch도 줄어든다