본문 바로가기
반응형

전체 글149

What is Abstract Class, Why & How to use What is Abstract Class: It is a class that contains one or more abstract methods. Why use Abstract Class: For resuseability code. When you want to create a class that is similar to another class. -> You can delete duplicate codes. -> You don't have to modify original class. -> You can use parent class code in child class. How to use Abstract Class: Maek an abstract class. Use extends for inherir.. 2022. 12. 6.
추상 클래스란(What), 사용하는 이유(Why), 사용법(How) 추상 클래스란(What): 하나 이상의 추상 메소드를 포함하는 클래스이다. 추상 클래스를 사용하는 이유(Why): 모든 객체를 클래스로 만들기 보다는, 추상적으로 큰틀의 클래스를 구현하고 싶을 때 사용한다. 코드를 재사용하기 위해 사용한다. 클래스를 추가하고 싶은데 기존의 클래스와 비슷할 경우 사용한다. 기존의 클래스에서 가져와서 새로운 클래스에 추가 및 수정할 경우 사용한다. -> 코드 중복을 제거할 수 있음 -> 기존의 클래스를 전혀 수정하지 않아도 됨 -> 자식 클래스에서 부모클래스의 코드를 사용할 수 있음 추상 클래스 사용법(How): abstract class로 만든다(실제 어플리케이션에서 인스턴스를 생성하지 않아도 되기 때문) extends를 통한 상속을 사용한다. 자식 클래스에서는 부모 클래.. 2022. 12. 6.
Install and run Redis on macOS Prerequisites: installed homebrew Install redis using terminal brew install redis brew services를 통한 redis 실행 brew services start redis brew services stop redis brew services restart redis Run redis-cli 2022. 12. 5.
맥 redis 설치 및 실행하기 전제: homebrew 설치 terminal을 통한 redis 설치 brew install redis brew services를 통한 redis 실행 brew services start redis brew services stop redis brew services restart redis redis-cli 사용 2022. 12. 5.
Spring Security에서 세션값 변경 서비스에서 update를 통해서 수정을 해도 DB에는 수정이 되지만 세션 변경을 하지 않았기 때문에 브라우저에는 수정 전의 정보가 여전히 남는 문제가 생긴다. 새로 로그인을 해야 수정된 정보로 나타나게 되는데 그러한 번거러움 없이 세션값을 변경하면 수정 후 정보가 바로 반영된다. 세션값 변경을 적용하기에 앞서 SecurityConfig 클래스 내부에 메소드를 생성한다. @Configuration @EnableWebSecurity @RequiredArgsConstructor public class SecurityConfig { @Bean public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationCo.. 2022. 12. 3.
thymeleaf html layout:decorate doesn't work I applied a layout at the top of signup_form.html But The layout didn't work. Because thymeleaf-layout-dialect library was missing. There was just spring-boot-starter-thymeleaf library. dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' Added the library dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'nz.n.. 2022. 12. 2.
thymeleaf html layout:decorate 적용안됨 signup_form.html 상단에 layout 적용을 하였다. 그런데 layout 적용이 안됬다. 이유는 build.gradle 파일에 thymeleaf-layout-dialect 라이브러리가 빠져있어서였다. dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' 아래와 같이 라이브러리 추가후 dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' layout이 잘 적용되었다. 2022. 12. 2.
Spring Error: resolved [org.springframework.web.httpmediatypenotsupportedexception: content type '' not supported, Error: response status is 415 When I was using Swagger with Spring, I got error. Error: resolved [org.springframework.web.httpmediatypenotsupportedexception: content type '' not supported How I solved: Add consumes = ALL_VALUE inside @GetMapping parenthesis @Operation(description = "개인정보조회", security = @SecurityRequirement(name = "bearerAuth")) @GetMapping(value = "/info", consumes = ALL_VALUE) public ResponseEntity menteeIn.. 2022. 12. 2.

반응형
반응형