public Message send(ReciveDto reciveDto) throws Exception {
try {
if(reciveDto.getNm().equals("") || reciveDto.getNm() == null){}
}catch (Exception e){
}
이거는 null이 파라미터로 오면 Exception 가지는데
public Message send(ReciveDto reciveDto) throws Exception {
try {
if("".equals(reciveDto.getNm()) || reciveDto.getNm() == null){}
}catch (Exception e){
}
이거는 왜 안갈까요?!!!!!!!!!!!!!!!!!!!!!!!!
reciveDto.getNm().equals("")
와
"".equals(reciveDto.getNm())
차이인데 하..............................
결국
StringUtils.isEmpty를 사용했음
StringUtils.isEmpty( reciveDto.getNm() )
'it-day' 카테고리의 다른 글
에러리포트(Consider defining a bean of type '' in your configuration.) (0) | 2023.11.28 |
---|---|
에러 리포트(parameter 1 of constructor in required a bean of type that could not be found) (0) | 2023.11.28 |
java package org.junit.jupiter.api does not exist maven 에러 (2) | 2023.11.21 |
html 요소 추가 꼼수(span) (0) | 2023.11.10 |
css 우선순위 적용(!important) (0) | 2023.11.07 |