zoukankan      html  css  js  c++  java
  • 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}发送表单数据
        --%>
  • 相关阅读:
    Neo4j
    linux系统中如何建立与删除软连接(方便快捷使用,大量节约时间)
    eclipse/myeclipse 中,如何删除已经下载过的插件(举例:删除scala ide)
    dayday up
    元类
    sort和sorted
    反射
    继承派生
    property
    python3.5和3.6区别
  • 原文地址:https://www.cnblogs.com/axibug/p/14915526.html
Copyright © 2011-2022 走看看