Or null (in which case the line below should check for null, not "") Or use StringUtils.isBlank()