第一次后台查询数据可以得到,
为什么第二次到后台查数据的时候,后台能打印出查询数据,但到前台无法得到数据呢?
查到是一组对放在list里的对象。
求解?????????

解决方案 »

  1.   

    前台:
    <s:iterator id="book" value="blist"><div> 
    </div><tr bgColor="#ffffff">
      <td width="109" bgColor="#ffffff" align="center"><a href="bookshow_detail.action?book.bookid=${book.bookid}">
      <img src="${book.image_url}" border="0" width="109" height="140"></a></td>
              <td width="97" bgColor="#ffffff" align="center">${book.bookname }</td>
              <td width="41" bgColor="#ffffff" align="center">¥${book.bookprice }</td>
              <td width="112" align="center">${book.author }</td>
              <td vAlign="center" width="42" align="center">
              <a href="bookshow_detail.action?book.bookid=${book.bookid}">
              <img src="images/view.gif" border="0" width="71" height="23"></a></td>
            </tr> 
    </s:iterator>
    后台:
    System.out.println(blist.isEmpty());
              for(Book list:blist){
              System.out.println("分类查询的作者名:"+list.getAuthor());
              System.out.println("分类查询的图书种类:"+list.getBookkind());
              System.out.println("分类查询的书名:"+list.getBookname());
              System.out.println("分类查询的PDF路径:"+list.getBookPDF_url());
              System.out.println("分类查询的图片路径:"+list.getImage_url());
              System.out.println("分类查询的书ID:"+list.getBookid());
              }
              List<String> bookKinds=bookInfoDaoImp.findBookKinds();
              ActionContext act = ActionContext.getContext();
          act.put("blist", blist);//图书集合
          act.put("bookKinds", bookKinds);//查询图书种类
          act.put("pageCount", pageCount);//页数
          act.put("RowCount", RowCount);// 总记录数
          act.put("intpageNow", intpageNow);//当前第几页
          List<Book> bli=(List<Book>) ActionContext.getContext().get("blist");
          return "bookshow";
    }
      

  2.   

    我觉得你的s:iterator应该配合<s:property value="" />使用
      

  3.   

    从前台迭代来看你的action里面应该有个book属性。
    我猜你第一次查询的时候应该是book属性是有赋值的第二次就没有了。
    你迭代里面拿的是${book.bookname}是book属性里的值不是迭代的元素里面的值
    如果是你要拿迭代的值直接${bookname} ${bookprice}
      

  4.   

    如果是你要拿迭代的值直接${bookname} ${bookprice}就是这个问题,太感谢了!!!!!!!!!