求教 关于SSH框架页面的传值问题

luojitao1020 2011-11-09 10:49:56
记录条数传递到页面了
但是数据就是不显示
<s:iterator var="ah" value="list">
<tr>
<td>
<input type="checkbox" name="one" value="<s:property value="#a.orgid"/>"/>
</td>
<td>
<s:property value="#ah.orgname"></s:property>
</td>
<td>
<s:property value="#ah.orglevel"></s:property>
</td>
<td>
<s:property value="#ah.parentorgid"></s:property>
</td>
<td>
<s:property value="#ah.orgseq"></s:property>
</td>
<td>
<s:property value="#ah.orgaddress"></s:property>
</td>
<td>
<s:property value="#ah.zipcode"></s:property>
</td>
<td>
<s:property value="#ah.linkman"></s:property>
</td>
<td>
<s:url var="tomodify" action="user!findById.action">
<s:param name="deptId" value="#ah.orgid"></s:param>
</s:url>
<s:a href="%{tomodify}">修改</s:a>
|
<s:url var="del" action="user!delete.action">
<s:param name="deptId" value="#ah.orgid"></s:param>
</s:url>
<s:a href="%{del}">删除</s:a>

</td>

</tr>

</s:iterator>

用的S标签取值..
没报错..
...全文
402 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
CSDW 2011-11-11
  • 打赏
  • 举报
回复
id 为对象。你要根据对象取值。 用id去点.
加嘞个油 2011-11-11
  • 打赏
  • 举报
回复
[Quote=引用楼主 luojitao1020 的回复:]
记录条数传递到页面了
但是数据就是不显示
<s:iterator var="ah" value="list">
<tr>
<td>
<input type="checkbox" name="one" value="<s:property value="#a.orgid"/>"/>
</td>
<td>
<s:property value="#ah.orgname"></s:prop……
[/Quote]


你和我刚才的问题一摸一样呀, 首先建议用c标签,S标签确实有点麻烦,比如:
//items里就是你select出来的对象。

如:List<aaaaa> xxxList;

xxxList=xxx.你的方法();

<c:forEach var="result" items="${xxxList}"> <tr align="center" >
<td >${result.xxx}</td>
<td >${result.xxxx}</td>
<td >${result.xxxxx}</td>
<td >${result.xxxxxx}</td>



然后要注意action里对xxxList 写了set/get方法:

public void setXxxList(List<aaaaa> xxxList){...}
public List<aaaa> getXxxList(){...}

再就是xml里<result>/xxx.jsp</result>地址要对。(这个是success的局部result)
freedomTTT 2011-11-11
  • 打赏
  • 举报
回复
<s:iterator var="ah" value="list">

?
value="${list}"
oowangfanoo 2011-11-11
  • 打赏
  • 举报
回复
用<s:XX>标签多麻烦啊。
直接el表达式
铀钚氕氘氚 2011-11-11
  • 打赏
  • 举报
回复
把var 改成id..就行了..如果用var 那标签就用${....}
insight1989 2011-11-10
  • 打赏
  • 举报
回复
debug 一次就知道了。
luojitao1020 2011-11-10
  • 打赏
  • 举报
回复
public List<Demoemployee> findByORGId(java.lang.Integer id) {

String sql = "select * from demoemployee where orgid=?";


Query query=sessionFactory.getCurrentSession().createSQLQuery(sql);
query.setInteger(0, id);

return query.list();


}
这是DAO方法
luojitao1020 2011-11-10
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 ys8616270 的回复:]

debug 一次就知道了。
[/Quote]

debug取到值了 可是页面调值调不出来..
luojitao1020 2011-11-10
  • 打赏
  • 举报
回复
debug取到值了 可是页面调值调不出来..
xiaoqiuwyh 2011-11-10
  • 打赏
  • 举报
回复
首先保证你的value="list"这个list要有值,然后把var换成id,应该就没问题了。
a3737500 2011-11-09
  • 打赏
  • 举报
回复
<s:property value="#ah.orgname"></s:property>换成这样的
<s: property value="%{ah.orgname} />"
shenjianox 2011-11-09
  • 打赏
  • 举报
回复
Map request=(Map)actioncontext.getactioncontext.get("request");
你把你取到的List<xxx> list集合放到request.put("list",list)对象里面,然后在页面里这样写<s:iterator id="ah" value="#request.list"> 把你的var换成id

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧