<%
HashMap cm = null;
String custom_no = request.getParameter("item_id");
if(!EasyStr.nil(custom_no)){
cm = new HeaderManager().load(custom_no);
pageContext.setAttribute("cm",cm); }
%> <td width="80" align="right" >领用单号:</td>
<td width="" align="left">${cm.item_id}</td>
<td width="" align="right" >领用部门:</td>
<td width="" align="left">${cm.item_dept}</td>
<td align="right" >领 用 人:</td>
<td align="left" >${cm.item_pro}</td>
<td align="right" >领用日期:</td>
<td align="left" >${cm.item_date}</td><c:forEach var="ad" items="${cm.details}" varStatus="status">
  <tr>
<td align="center">${ad.item_name_id}</td>
<td >${ad.item_name}</td>
<td >${ad.item_code}</td>
<td align="right" >${ad.item_number}</td>
<td >${ad.item_unit}</td>
<td >${ad.item_spce}</td>
      </tr>
</c:forEach>
*/
public HashMap load(String item_id){
Connection conn = null;
Statement stmt = null;
ResultSet rst = null;
String sql = " select * from office_item_header oi where oi.item_id='"+item_id+"'";
String dsql="select * from office_item_detail u where u.item_id='"+item_id+"'";
try{
conn = new DbConnect().getDBConnection();
stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY);
rst = stmt.executeQuery(sql);
HashMap h = EasyCollect.getMap(rst);
rst.close();
if(h.isEmpty()){
return null;
}
System.out.println("查询"+sql+" //n "+dsql);
rst = stmt.executeQuery(dsql);
List details = EasyCollect.getResult(rst);
h.put("details", details);
return h;
}catch(Exception e){
try {
conn.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}finally{
EasyDB.close(rst, stmt, conn);
}
return null;
}
就是list里面没值 不是list里面的值都可以取出来。