Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to check NULL in jstl?

843840Sep 28 2007 — edited Sep 28 2007
Hi
I have a list of items *${nameList}* I need to print them in a table as follows. I need to check if the elements are not null before printing:

My code is as follows. But right now it is checking for NULL value. Kindly let me know pls!
 <table class="display" border="1"  bordercolor=#dddddd > 
                        <tr>                           
                            <td>Number</td><td>Sample Name</td><td>Number</td><td>Sample Name</td><td>Number</td><td>Sample Name</td><td>Number</td><td>Sample Name</td>
                        </tr>
                        <c:forEach var="x" begin="${0}" end="${11}">
                            <c:set var="k" value="${x}"/>
                            <tr> 
                                <c:forEach var="y" begin="${1}" end="${4}">
                                    <c:if test="${k < maxSample}"> 
                                        <c:if test="${nameList[k] != ''}">
                                            <td><c:out value="${k+1}"/></td><td><c:out value="${nameList[k]}"/></td>
                                        </c:if>
                                    </c:if>
                                    <c:set var="k" value="${k+12}"/>
                                </c:forEach>                        
                            </tr>  
                            
                        </c:forEach>
                        </table>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 26 2007
Added on Sep 28 2007
6 comments
4,446 views