form表單如何提交list集合到服務器實現數據交互


    <form action="${list}" method="get" name="ProductForm" id="theProductForm" class="#">
    <%--
    action:表單提交時向${list}發送表單數據
    method:表單數據提交方式
    name  :控制表單控件
    id    :區別不同的表單控件
    class : 指定表格css樣式類
    --%>
    <table border="1" cellpadding="0" cellspacing="0" width="50%">
        <tr>
            <th>商品編號</th>
            <th>商品名稱</th>
            <th>商品價格</th>
            <th>商品產地</th>
            <th>操作</th>
        </tr>
        <tr>
            <!-- jstl jsp里寫java (T_T) forEach遍歷list-->
            <c:forEach var="product" items="${list}">
            <td>${product.id}</td>
            <td>${product.name}</td>
            <td>${product.price}</td>
            <td>${product.address}</td>
            <td>
                <a href="#">刪除</a>
            </td>
        </tr>
        </c:forEach>
    </table>
    </form>

 

又是一個小細節:
el表達式在jsp里單行注釋里仍有效(果然哪都能寫),但是在多行注釋里失效

    <!-- ${list} --> 
    <%--
    當action表單提交時向${list}發送表單數據
    --%>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM