在页面中,显示联表出来的属性
查询语句如下:
String hql = "from TbBook where tbBooktypeson.id="+id;
TbBook实体类关键的属性:
private TbBooktype tbBooktype;
TbBooktypeson实体类关键的属性
private String typeName;
private Set tbBooks = new HashSet(0);
action类关键代码:
ActionContext.getContext().put("listbook", listbook);
页面关键代码:
<!-- 循环输出 -->
<s:iterator id="list" value="listbook">
<div style="float:left;width:335px;height:200px;border:1px solid #CCC;margin:10px;">
<img src="<s:property value="bookurl"/>" style="width:150px;height:200px;float:left;"/>
<ul style="float:left;margin:0px;padding-left:8px;">
<li style="line-height:15px;font-size:18px;margin-top:8px;width: 170px;"><a href="recption.action?bookId=<s:property value="bookId"/>"> <s:property value="title"/> </a></li>
<li style="line-height:15px;height:20px;font-size:12px;color:#CCC;margin-top:5px;margin-left:5px;"><s:property value="author"/></li>
<li style="margin-top:20px;font-size:12px;color:#CCC;width:170px"><s:property value="bookdescribe" escape="false"/></li>
<li> <s:property value="tbBooktypeson.typeName"/></li>
</ul>
</div>
</s:iterator>
在页面中如何显示 typeName的信息?