일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 맛집
- devops
- java
- 요리
- docker
- Git
- ubuntu
- jenkins
- ReactJS
- Design Patterns
- AWS
- db
- tool
- Spring Boot
- javascript
- IntelliJ
- php
- Oracle
- redis
- it
- JPA
- Web Server
- Spring
- elasticsearch
- springboot
- linux
- MySQL
- laravel
- Gradle
- jsp
- Today
- Total
목록Spring (73)
아무거나
AWS JAVA SDK 사용시 AWS Credential 클래스별 자격증명 (AWS Credential 관련 코드를 작성할 때 필수적으로 참고해야되는 내용이다.) BasicAWSCredentials 직접 accessKey, secretKey 설정 ... .withCredentials( new AWSStaticCredentialsProvider( new BasicAWSCredentials( "{accessKey}", "{secretKey}" ) ) ) ... DefaultAWSCredentialsProviderChain 기본 작업 공급자 체인이며 하기 순서대로 자격 증명을 찾는다. EnvironmentVariableCredentialsProvider 환경변수 AWS_ACCESS_KEY_ID 과 AWS_SE..
spring boot 2.5 이상부터 생성된다고함 -plain 이 붙은 jar 파일은 plain archive 라고하며 애플리케이션 실행에 필요한 모든 의존성을 포함하지 않고, 작성된 소스코드의 클래스 파일과 리소스 파일만 포함 (즉, 모든 의존성이 존재하지 않기 때문에 java -jar 명령어로 실행시 오류가 발생) plain.jar 생성 방지를 위한 설정 추가 [build.gradle] ... jar { enabled = false }
@NotEmpty 등과 같은 Annotation 이 import 안될 때 NotEmpty 등과 같은 Annotation 은 javax.validation.constraints 패키지에 존재한다. 또한 스프링부트 2.3 이상부터 포함되지 않고 따로 의존성을 추가하여야한다. 의존성 추가는 하기 코드를 참고 [build.gradle] dependencies { implementation 'org.springframework.boot:spring-boot-starter-validation' }
결과값 리턴값이 String 인 경우 한글이 깨지는 현상 (설정 파일에서 인코딩을 지정해도 안될 경우) 원인은 HTTP 메소드 컨버터의 StringHttpMessageConverter 에서 기본 옵션 ISO-8859-1을 발견 해결방법 String 이 아닌 다른 값으로 가공 (굳이 String 이 아닌 Response Model 클래스를 따로 만들어서 리턴하였음) WebConfig 의 configureMessageConverters 오버라이딩하여 converter.setWriteAcceptCharset(false); 로 변경 @Configuration public class WebMvcConfig extends WebMvcConfigurerAdapter { @Override public void conf..
Blocked mirror for repositories .. 에러가 표시되며 다운로드가 안되는경우 현재 폐쇠망에서 특정 모듈을 Nexus에 모아 사용하고 있는 상태이며 알아본 결과 Maven 3.8.1 버전부터 http에 대한 외부 연결을 막는 설정이 default로 변경되었다고함 해결방법은 해당 nexus를 https로 변경시켜주는 방법 또는 maven의 settings.xml에 http를 무력화 시켜주는 코드를 삽입하는 총 두 가지의 방법이 있으며 우선 settings.xml 을 활용하는 방법으로 진행하였다. [settings.xml] ... maven-default-http-blocker external:dont-match-anything-mate:* Pseudo repository to mirr..
Ehcache build.gradle ... dependencies { ... // 캐시관련 설정을 편리하게 지원해주는 패키지 (CacheManager, EhCacheManagerFactoryBean 등의 bean 생성을 직접 안할수 있음) implementation 'org.springframework.boot:spring-boot-starter-cache' // Ehcache implementation group: 'net.sf.ehcache', name: 'ehcache', version: '2.10.6' } ... EhCache 설정 체크 관련 Component 추가 (CommandLineRunner를 통해 Application 실행시 무조건 run() 이 실행되도록 하여 CacheManager를..
소스: base-document/springsecurity.md at master · bkjeon1614/base-document (github.com) Spring Security + H2 DB + Swagger 연동시 페이지 접근 예외 처리 [SecurityConfig.java] import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configura..
Library Document Jasypt를 활용한 Application Property 암호화 Application.yml 에다 보통 DB 접속정보등의 데이터가 기재되어있다. 이러한 내용을 외부에서 탈취해갈 위험성을 대비하여 jasypt를 활용하여 보안을 강화하자 http://www.jasypt.org/download.html 에서 jasypt 다운 (1.9.2 버전 기준) 압축 풀고 cmd에서 bin 폴더로 이동 (./file/jasypt-1.9.3/bin) encrypt input="bkjeontest!@" password="bkjeon!@" algorithm="PBEWITHMD5ANDDES" (온라인 암/복호화 사이트 https://www.devglan.com/online-tools/jasypt-..
Lombok 사용시 주의사항 (1.16 기준) lombok.config를 통하여 애노테이션 사용금지 및 각종 설정 config.stopBubbling = true lombok.data.flagUsage=error lombok.value.flagUsage=error lombok.val.flagUsage=error lombok.var.flagUsage=error lombok.nonNull.flagUsage=error lombok.allArgsConstructor.flagUsage=error lombok.requiredArgsConstructor.flagUsage=error lombok.cleanup.flagUsage=error lombok.sneakyThrows.flagUsage=error lombok.sy..
Intellij Lombok 사용 (Mac) Preference -> Plugins -> Browse Repositories 에서 Lombok Plugin 추가 Prepference -> Build, Execution, Deployment -> Compiler -> Annotation Processors "Enable Annotation Processors" 체크 Lombok Annotations @Getter @Setter Getter / Setter Method 생성(모든 필드의 타입에 맞추어 생성) Class에 적용하면 static을 제외한 모든 필드에 적용 AccessLevel 을 명시하지 않으면 public 종류: PUBLIC, PROTECTED, PACKAGE, PRIVATE, NONE 특정 ..