일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- IntelliJ
- sapfiorielements
- Linux
- gson
- springboot
- database
- dbeaver
- Git
- Java
- Kubernetes
- Windows
- maven
- nginx
- docker
- JavaScript
- MySQL
- mybatis
- tibero
- VSCode
- NCP
- useEffect
- react
- gradle
- SAP
- BPMN
- nodejs
- log4j2
- JPA
- LOG4J
- Spring
- Today
- Total
목록전체 글 (263)
두 손끝의 창조자
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