▣ Framework/Spring🍃

    [Spring] ~ cannot be resolved to a type 해결방법 [Logger, Aspect, JoinPoint, Before 등]

    - ~ cannot be resolved to a type 에러 발생 Maven 프로젝트를 import 했더니, 아래와 같이 에러가 발생하였다. 롬복도 정상적으로 설치가 되었고, import도 잘 된 상태였다. - ~ cannot be resolved to a type 해결 방법 pom.xml에서 해당 라이브러리를 확인해보니 가 runtime이였다. → 해당 라이브러리를 컴파일이 아닌 실행 시에 동작하게 하는 것! - 참고 자료 [Spring] @Log4j org.apache.log4j.Logger cannot be resolved to a type 오류 해결 방법 오류 내용 : Spring Legacy Project > Spring MVC Project 환경에서 @Log4j 사용시 오류가 발생했다. l..

    [Spring] java.sql.SQLException: Table 'counsel.persistent_logins' doesn't exist [Spring Security 관련 에러]

    - Spring Security 관련 에러 Spring Security를 적용하는 과정에서 아래와 같은 에러가 발생하였다. PreparedStatementCallback; bad SQL grammar [delete from persistent_logins where username = ?]; nested exception is java.sql.SQLSyntaxErrorException: (conn=2867) Table 'counsel.persistent_logins' doesn't exist 처음에는 뭐가 문제인지 몰라 한참을 헤메다가 아래 내용에서 해답을 찾았다. java.sql.SQLException: Table 'counsel.persistent_logins' doesn`t exist // 해석하면..

    [Spring] security로 인한 403 에러 해결하기(2) [API 사용에 따른 403 에러 발생]

    - API 사용에 따른 403 에러 발생 - API 사용 시의 403 에러 해결 방법 SecurityConfig.java에 아래와 같이 csrf 관련 메서드 추가한다. - SecurityConfig.java @Override protected void configure(HttpSecurity http) throws Exception { http.formLogin().loginPage("/member/login").loginProcessingUrl("/login"); http.logout().logoutUrl("/logout").logoutSuccessUrl("/"); http.rememberMe().tokenRepository(persistentTokenRepository()); // 아래 두 줄 추가 ..

    [Spring] security로 인한 403 에러 해결하기(1) [비동기 처리에 따른 403 에러 발생]

    - 비동기 처리에 따른 403 에러 발생 - 비동기 처리 403 에러 해결 방법 var headerName = $("meta[name='_csrf_header']").attr("content"); var token = $("meta[name='_csrf']").attr("content"); $(document).ajaxSend(function(e, xhr) { xhr.setRequestHeader(headerName, token); }); [Spring] security로 인한 403 에러 해결하기(2)[API 사용에 따른 403 에러 발생] - API 사용에 따른 403 에러 발생 - API 사용 시의 403 에러 해결 방법 SecurityConfig.java에 아래와 같이 csrf 관련 메서드 추가한..

    [Spring] Java 기반으로 Spring 설정 변경하기(5) [파일첨부 기능 적용]

    [Spring] Java 기반으로 Spring 설정 변경하기(4)[security로 인한 한글 깨짐 해결하기] [Spring] Java 기반으로 Spring 설정 변경하기(3)[security, csrf 적용] [Spring] Java 기반으로 Spring 설정 변경하기(2)[jsp 연동 및 라이브러리 적용] [Spring] Java 기반으로 Spring 설정 변경하기(1)[xml 기.. yermi.tistory.com - 파일첨부 기능 적용 - WebConfig.java package works.yermi.config; // import 생략 public class WebConfig extends AbstractAnnotationConfigDispatcherServletInitializer{ // 코드..