[SpringBoot] Mapper 설정
src/main/java에 domain구조로 프로젝트를 설정하여, controller/service/mapper로 패키지를 구성하였으며, src/main/resources에 mapper 패키지에 xml을 생성하였다. mapper와 mapper/xml을 연결하는 설정은 아래와 같다. application.properties # mybatis settings mybatis.mapper-locations:mapper/**/*.xml
2024.02.08
Circular view path [getTest]: would dispatch back to the current handler URL [/getTest] again. Check your ViewResolver setup!
controller에서 viewResolver에 대한 셋팅을 안해서 생긴 이슈
2023.06.03
[SpringBoot] java.lang.Long cannot be cast to java.lang.Integer
db에서 가져온 데이터를 Integer로 캐스팅 하던중 오류 발 Integer.parseInt(String.valueOf( ~~ )); 해주니 해결
2023.02.11
[Spring Boot] log4j DB로그 확인
console을 통해서 db작업 확인을 하기 위해 추가하였다. 1. build.gradle // sql log implementation 'org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16' 2. application.properties //application.properties spring.datasource.driverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy spring.datasource.url = jdbc:log4jdbc:mysql:~~~ 3. resources에 파일 두개 추가 //log4jdbc.log4j2.properties log4jdbc.spylogdelegator.name=net.sf.log4j..
2023.02.11
[SpringBoot] Spring Security
암호화 작업을 하기 위하여 스프링 시큐리티를 사용하였다. 1. build.gradle에 추가 //build.gradle //spring security implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5' 2. util @EnableWebSecurity @AllArgsConstructor @Configuration public class SpringSecurity{ /** * 패스워드 암호화 * */ @Bean public PasswordEncoder getPasswordEncoder() { return n..
2023.02.11
no image
[SpringBoot] MyBatis application.properties 설정
# mybatis settings mybatis.mapper-locations = mybatis/**/*.xml mybatis.config-location = classpath:mybatis-config.xml
2023.02.06
[SpringBoot] MySql application.properties 설정
# mysql database settings spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver spring.datasource.url = jdbc:mysql://localhost:3306/schema?serverTimezone=UTC&characterEncoding=UTF-8 spring.datasource.username = id spring.datasource.password = pw
2023.02.06