zoukankan      html  css  js  c++  java
  • 关于“foreach循环”中遇到的几个问题总结

    1.列表页面用"foreach循环"的时候数据没有显示,此时需要检查你对象模型中属性的首字母是否大写切记不能大写(本人在做一个项目的时候,对象模型是别人建立的,属性首字母大写了,导致最后列表页面数据不显示,后来一问老师,说改为小写,瞬间好了)。
    2.数据存储不到表里:在映射文件中没有指定数据表列名的时候,数据表列名必须和属性名相同(应用于hibername操作数据库中)。

    3.用foreach的时候,从其他页面跳到本页面数据内容不显示,此时在其他页面中必须把跳转到本页面的路径改为浏览器中的访问路径。

     1 <table class="table_style">
     2                             <thead>
     3                                 <tr>
     4                                     <th>
     5                                             <input id="all" type="checkbox" onclick="selectAll();" value="checkbox"> 
     6                                         <label>全选 </label>
     7                                     </th>
     8                                     <th>样本编号</th>
     9                                     <th>被检者姓名</th>
    10                                     <th>被检者ID</th>
    11                                     <th>医院名称</th>
    12                                     <th>样本类型</th>
    13                                     <th>手机</th>
    14                                     <th>创建时间</th>
    15                                 </tr>
    16                             </thead>
    17                             <c:forEach var="hello" items="${key}" step="1" >
    18                                 <tr>
    19                                     <td>
    20                                           <input  type="checkbox"   value="${hello.iD}" name="checkbox">
    21                                     </td>
    22                                     <td>
    23                                         <a href="javascript:void(0)">${hello.sampleNo}</a>
    24                                     </td>
    25                                     <td>${hello.name}</td>
    26                                     <td>${hello.pId}</td>
    27                                     <td>${hello.hospitalName}</td>
    28                                     <td>${hello.sampleType}</td>
    29                                     <td>${hello.cellPhone}</td>
    30                                     <td>${hello.createTime}</td>
    31                                 </tr> 
    32                             </c:forEach>   
    33 
    34                         </table>
  • 相关阅读:
    word2vec层次化softmax理解
    python动态加载模块,并获取模块中的类与方法(类似反射)
    用Python装饰器给函数自动加上try except
    3D打印第二弹:狗牌
    【高等代数】06
    【高等代数】05
    沙箱-guacamole
    关于写博客的一点思考
    二阶段目标检测总结
    Waymo object detect 2D解决方案论文拓展
  • 原文地址:https://www.cnblogs.com/sushu-yaya/p/6823302.html
Copyright © 2011-2022 走看看