need to use `StringUtils.hasText()`; `hasAttribute` allows an empty String.