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