mardi 5 mai 2015

how to show particular table head in jsp according request parameter from Servlet?

Atttach tag to servlets attribute:

String show = null;
req.setAttribute(show, "itemList");

How to show table head according to attribute from servlets

 <table>
        <c:if test="${show="itemList"}">
                    <thead>
                        show info1
                    </thead>
        </c:if>
        <c:if test="${show="historyItemList"}">
                     <thead>
                        show info2
                     </thead>
         </c:if>

                    <tbody>
         <c:forEach items="${userItemsList}" var="item">
                    <tr>
                        <td><c:out value="${item.id}" /></td>
                        <td><c:out value="${item.title}" /></td>
                        <td><c:out value="${item.link}" /></td>
                    </tr>
         </c:forEach>
            </tbody>
    </table>

Who knows?

Aucun commentaire:

Enregistrer un commentaire