일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Git
- MySQL
- wildfly
- jetbrains
- gradle
- JPA
- gson
- Spring
- react
- nginx
- maven
- log4j2
- Java
- intellijIDEA
- useEffect
- database
- BPMN
- LOG4J
- nodejs
- docker
- JavaScript
- VSCode
- Kubernetes
- mybatis
- IntelliJ
- NCP
- Windows
- tibero
- springboot
- dbeaver
- Today
- Total
목록분류 전체보기 (238)
두 손끝의 창조자
MyBatis는 특정 메소드를 인터셉트 할 수 있는 애노테이션인 Intercepts 을 제공한다. Intercepts 의 값으로 메소드 시그니처를 지정해야하는데 메소드 시그니처를 지정하는 애노테이션이 Signature 이다. 메소드 시그니처는 메소드이름과 파라미터 타입이므로 인터셉트 할 메소드를 정확하게 지정한다. 예를 들어 org.apache.ibatis.executor.Executor 인터페이스는 ... int update(MappedStatement ms, Object parameter) throws SQLException; List query(MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler)..
PrefixContext base64 Base64 encoded data. The format is ${base64:Base64_encoded_data}. For example: ${base64:SGVsbG8gV29ybGQhCg==} yields Hello World!. bundle Resource bundle. The format is ${bundle:BundleName:BundleKey}. The bundle name follows package naming conventions, for example: ${bundle:com.domain.Messages:MyKey}. ctx Thread Context Map (MDC) date Inserts the current date and/or time usi..
import java.text.FieldPosition def pos = configure(new FieldPosition(10)) { beginIndex = 1 endIndex = 5 } println pos.beginIndex println pos.endIndex Gradle 공홈에서 문서를 보고 있는데 위와 같은 구문이 있었다. 그런데 이 문법이 이해가 안 갔다. configure 가 Prject 인터페이스의 메소드인건 알겠고, 파라미터로 FieldPosition 의 인스턴스를 넘기는 것도 알겠고.. 그런데 그 뒤에 있는 클로저는 뭐지..? 그루비는 클로저가 메서드의 마지막 인수인 경우, 외부에서 클로저를 넣을 수 있는 문법을 제공한다. 이딴건 왜 제공하는지 모르겠다. 사람 헷갈리게 그래서 위 구문..
WEB-INF 밑에 jboss-web.xml 파일을 만들고 /pmf 컨텍스트 루트 이름을 입력한다. 기본값은 war 파일명이다.
log4j 뿐만아니라 slf4j 를 사용하든, logback 을 사용하든 wildfly는 logger를 자체 정의하고 있기 때문에 기본값으로 놔두면 logger 우선순위에서 밀려서 내가 정한 logging 옵션을 사용하지 못 한다. 사용하게 하려면 META-INF 또는 WEB-INF 밑에 jboss-deployment-structure.xml 파일을 만들고 내용을 입력한다. 사용하는 로거에 따라서 module에 추가한다.
소스 코드 domain project 소스코드 package cothe.service; import cothe.entity.Yo; import javax.transaction.Transactional; public class YoService { private final YoRepository yoRepository; public YoService(YoRepository yoRepository) { this.yoRepository = yoRepository; } @Transactional public void updateName(Long id, String name) { Yo yo = yoRepository.findById(id).get(); yo.updateName(name); } @Transactio..
application.properties에 logging.level.org.apache.coyote.http11=debug 꼭 스프링부트가 아니어도 로거에 org.apache.coyote.http11 를 debug로 출력하게 하면 요청정보가 출력될 것임(톰켓을 썼을 때)
$/usr/libexec/java_home -V $/usr/libexec/java_home -v11 은 11버전의 경로 출력
brew install --cask anaconda 로 설치했을 때 anaconda 위치는 /opt/homebrew/anaconda3 이다. 이 위치가 path에 지정되어 있지 않기 때문에 conda를 terminal에서 바로 사용할 수 없다. 경로를 등록하자. .zshrc에 export PATH=[conda위치]:$PATH
작성한 테스트 스크립트를 많은 호스트가 실행을 하게 해서 타겟에 부하를 주고 그 결과를 모니터링 하는 솔루션이다. 크게 콘트롤러와 에이젼으로 구성된다. 콘트롤러는 웹 애플리케이션인데 테스트 스크립트를 생성하고 실행을 구성한다. 에이전트는 가상 사용자를 만들어서 부하를 발생시킨다. 콘트롤러에서 에이전트를 지정하고 에이전트에게 스크립트를 실행하게 하는 구조이다. 스크립트 Jython, Groovy 스크립트를 사용할 수 있다. IDE에서 Groovy 스크립트를 개발 및 테스트를 할 수 있고 이것을 에이전트에게 실행시킬 수있다. 다운로드 Releases · naver/ngrinder (github.com) Releases · naver/ngrinder enterprise level performance test..
persistence.xml 없이 자바로 속성 설정해서 사용하려면 @Bean public EntityManagerFactory entityManagerFactoryForMysql(DataSource dataSource) { final Properties properties = new Properties(); properties.put( "hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect" ); // MySql5x 쓴다면 properties.put( "hibernate.user_sql_comments", "true" ); properties.put( "hibernate.format_sql", "true" ); properties.put( "hibernat..
MyBatis Mapper 스캔은 스캔을 설정한 패키지와 하위 패키지를 검색하여 등록하거나, 베이스 패키지와 그 하위 패키지를 검색하여 매퍼로 등록한다. 별도 설정을 하지 않으면 하위 패키지내에 있는 인터페이스는 모두 매퍼로 등록을 한다. 지원낭비이자 이중 빈 등록으로 인한 문제가 생길 수 있다. 매퍼 인터페이스를 한 군데 정해서 지정하면 간단하게 해결되지만 기능 별로 다른 패키지에 매퍼가 있을 경우는 좀 곤란하다. 패턴으로 매퍼의 위치를 지정할 수 없기 때문이다. 매퍼 스캔 옵션에 annotationClass 를 Mapper.classs 를 지정하면 @Mapper 애노테이션이 있는 인터페이스만 매퍼로 등록한다. 참고로 매퍼 xml을 지정하고, namespace에 인터페이스를 정확하게 입력했다면 그 인터..
톰캣을 intellij에서 실행하면 로그에 한글이 깨질 수 있다. -Dfile.encoding=UTF-8를 Run/Debug Configurations 에 VM options에 추가할 것
ITemplateResolver 를 ClassLoaderTemplateResolver 를 사용한다. public ITemplateResolver templateResolver() { ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver(); templateResolver.setPrefix("templates/"); templateResolver.setSuffix(".html"); templateResolver.setTemplateMode(TemplateMode.HTML); templateResolver.setCacheable(false); return templateResolver; }
Thymeleaf 홈페이지에 Spring과 연동하는 소스를 가져와서 테스트 했는데 아무리 해도 뷰가 매핑이 되지 않았다. 몇 시간 헤매다가 아래 구문에서 문제가 있었다. viewResolver.setViewNames(new String[]{".html", ".xhtml"}); 당연하게도 xxx.html 파일과 매핑을 위한 설정정보라고 생각했는데 Controller에서 반환한 뷰 이름과 패턴 매치해볼 대상들이었다. 컨트롤러에서 뷰 이름만 리턴했으니 .html 과 같은 것이 매치가 될 리가 없다. 무슨 샘플 소스를 이따구로... https://www.thymeleaf.org/doc/tutorials/3.0/thymeleafspring.html
Controller를 기본 대상에서 포함시키고, 기본 필터를 끈다. @ComponentScan(basePackages = {"com.dongkuk.dmes.cr"}, includeFilters = @ComponentScan.Filter( type = FilterType.ANNOTATION, classes = {Controller.class} ), useDefaultFilters = false)
web.xml 을 대체해서 사용할 수 있는 진입점을 제공하는 인터페이스이다. 클래스 패스에 META-INF/services/javax.servlet.ServletContainerInitializer 파일에 ServletContainerInitializer 구현한 클래스 전체 이름을 넣으면 컨테이너가 올라오면서 onStartup 메소드를 실행한다.
Servlet Version WAS Servlet 4.0 Tomcat9>=, *SpringBoot2, WildFly14>= Servlet 3.1 Tomcat8>=, Jeus7 Servlet 3.0 Tomcat7
servlet 4.0 servlet 3.1 servlet 3.0