Java(154)
-
Spring boot Caused by: java.lang.Error: Unresolved compilation problem: Value cannot be resolved to a type
@Value 어노테이션을 인식하지 못하는 경우 발생함STS에서 자동으로 import를 찾지 못해서, 수동으로 import를 넣고 실행하면 에러 발생함pom.xml에 아래 내용 추가해서 해결함 org.springframework.boot spring-boot-configuration-processor true
2024.12.29 -
Mybatis 로그 설정
logback/resourcs/logback-spring.xml %d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n Spring bootapplication.propertieslogging.level.org.mybatis=DEBUGlogging.level.org.apache.ibatis=DEBUGlogging.level.java.sql.PreparedStatement=DEBUGlogging.level.java.sql.Statement=DEBUGlogging.level.java.sql.ResultSet=DEBUGapp..
2024.12.28 -
Spring boot java.lang.IllegalStateException: No primary or single unique constructor found for interface javax.servlet.http.HttpServletRequest
Spring boot 3.x 부터는 javax.servlet.http.HttpServletRequest를 지원하지 않음jakarta.servlet.http.HttpServletRequest를 사용해야 함
2024.12.28 -
Spring boot 외부 디렉토리를 static으로 인식하기
외부 디렉토리를 static으로 설정spring.web.resources.static-locations=file:/uploads/여러 디렉토리를 static으로 설정spring.web.resources.static-locations="file:/uploads/classpath:/static/"
2024.12.27 -
STS 사용하지 않는 import 제거 단축키
Ctrl + Shift + O
2024.12.27 -
Mybatis insert후 키값 반환하기
쿼리 SELECT to_char(current_timestamp,'yyyymmdd')||lpad(nextval('seq_test')::TEXT, 3, '0') INSERT INTO test( id, name ) VALUES ( #{id}, #{name} )서비스public String create(Map attach) { testMapper.create(attach); return attach.get("id").toString(); // Retrieve pre-generated ID}
2024.12.27