Database - 데이터베이스 ( DB )
invalid comparison: java.util.ArrayList and java.lang.String
정리하고기록하자
2022. 10. 6. 10:14
반응형
invalid comparison: java.util.ArrayList and java.lang.String
에러 원인 : list의 경우는 != '' 와 비교 할 수 없다.
<if test="list !='' and list !=null">
<foreach collection="list" item="item" index="index" separator="," open="(" close=")">
#{item.value}
</foreach>
</if>
에러 해결 : 해 list를 size() 로 변경 해서 사용한다.
<if test="list.size != 0">
<foreach collection="list" item="item" index="index" separator="," open="(" close=")">
#{item.value}
</foreach>
</if>
반응형