Action
public String listByType() {
Map<String, Object> session = ActionContext.getContext().getSession();
session.put("bytype", getStrType());
bytypes = bookService.getByType(getStrType());
ActionContext.getContext().put("bytypes", bytypes);
System.out.println(bytypes);
if (bycases != null) {
return "bytype";
} else
return "bynotype"; }
     get  、set
public List<Book> getBytypes() {
return bytypes;
}
public void setBytypes(List<Book> bytypes) {
this.bytypes = bytypes;
}DAOpublic List<Book> getByType(String booktype) {
Book book = null;
List<Book> list = new ArrayList<Book>();
String hql = "from Book b where b.booktype=?";
List<?> l = this.getHibernateTemplate().find(hql, booktype);
Iterator<?> ite = l.iterator();
System.out.println("根据图书类型    " + booktype + "  查询到的图书  ");
while (ite.hasNext()) {
book = (Book) ite.next();
list.add(book);
System.out.println(book.getId() + "\t" + book.getBookname() + "\t"
+ book.getBookcode() + "\t" + book.getBookcase() + "\t"
+ book.getAuthor() + "\t" + book.getBooktype() + "\t"
+ book.getRe() + "\t" + book.getBdays() + "\t"
+ book.getDelflag());
}
return list;
}struts.xml
<result name="bytype">/pages/booktype/booktypeList.jsp</result>JSP<s:iterator value="bytypes"  status="stat">
<ul class="bd-list">
<li>
         <span>id</span>
<s:property value="id"/>
                        </li>
.....
</s:iterator >控制台可以输出 btyps 里面Book 对象所有值,但是jsp 页面s:iterator无法将bytypes里面的对象显示出来