문제

When a post method is submitted, a JSP page shows the result in fields in the next page. How can I red mark those fields who gets null value in the 2nd page?

도움이 되었습니까?

해결책

Within the forEach loop you can write,

<c:choose>
    <c:when test='${iterator.name eq ''}'>
        <td style='background-color:red;'> <c:outvalue="${iterator.name}"/> </td>
    </c:when>
    <c:otherwise>
        <td> <c:outvalue="${iterator.name}"/> </td>
    </c:otherwise>
</c:choose>

As you can see when the value will be null you can set the background color of that cell to red and when it returns some value you can display it the way you were doing it before.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top