jsp页面:
<body id="pa"ge>
<h2>客户资料信息</h2> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr>
<th>客户管理员帐号</th>
<th>密码</th>
<th>姓名</th>
<th>创建时间</th>
<th>备注</th>
<th>操作</th>
</tr>
<s:iterator value="clientUsers" var="list">
<tr>
<td><s:property value="#list.CUusername"/></td>
<td><s:property value="#list.CUpassword"/></td>
<td><s:property value="#list.CUname"/></td>
<td><s:property value="#list.CUtime"/></td>
<td><s:property value="#list.CUre"/></td> <td><button>删除</button>
<button>重置</button></td>
</tr>
</s:iterator>
</table>
</body>acton:
public class ViewClientUserAction extends ActionSupport{
private List<ClientUserBean> clientUsers;
private SystemUserManager SUmanger; public SystemUserManager getSUmanger() {
return SUmanger;
} public void setSUmanger(SystemUserManager sUmanger) {
SUmanger = sUmanger;
} public List<ClientUserBean> getA() {
return this.clientUsers;
} public void setA(List<ClientUserBean> clientUsers) {
this.clientUsers = clientUsers;
}
public String list() throws Exception{
clientUsers = SUmanger.getClientUsers();
System.out.println(clientUsers.size());//这里打印出 3
if(clientUsers.size()>=1){
return SUCCESS;
}
return ERROR;
}
}s:iterator总是迭代不出数据。。这是怎么回事啊
<body id="pa"ge>
<h2>客户资料信息</h2> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr>
<th>客户管理员帐号</th>
<th>密码</th>
<th>姓名</th>
<th>创建时间</th>
<th>备注</th>
<th>操作</th>
</tr>
<s:iterator value="clientUsers" var="list">
<tr>
<td><s:property value="#list.CUusername"/></td>
<td><s:property value="#list.CUpassword"/></td>
<td><s:property value="#list.CUname"/></td>
<td><s:property value="#list.CUtime"/></td>
<td><s:property value="#list.CUre"/></td> <td><button>删除</button>
<button>重置</button></td>
</tr>
</s:iterator>
</table>
</body>acton:
public class ViewClientUserAction extends ActionSupport{
private List<ClientUserBean> clientUsers;
private SystemUserManager SUmanger; public SystemUserManager getSUmanger() {
return SUmanger;
} public void setSUmanger(SystemUserManager sUmanger) {
SUmanger = sUmanger;
} public List<ClientUserBean> getA() {
return this.clientUsers;
} public void setA(List<ClientUserBean> clientUsers) {
this.clientUsers = clientUsers;
}
public String list() throws Exception{
clientUsers = SUmanger.getClientUsers();
System.out.println(clientUsers.size());//这里打印出 3
if(clientUsers.size()>=1){
return SUCCESS;
}
return ERROR;
}
}s:iterator总是迭代不出数据。。这是怎么回事啊
解决方案 »
- 关于下拉菜单与查询的问题
- 如何在windows客户端用JSP控制linux服务器端执行编写好的shell script
- 如何用java做登陆界面?
- 关于java中post方式发送请求的简单却特殊的问题
- MyEclipse 没有响应 JVM terminated. Exit code=1073807364
- Linux+Tomcat+mySQl乱码问题
- 有没有办法?在1.htm把2.htm框架的同时加上个一段代码语言,替换不要的代码呢,
- 请问怎么修改Java虚拟机的编码为GB2312?
- 报这样的脚本错是什么问题?高手指教: 样式表没有包含文档元素
- jsp中如何从表单中取得下拉菜单(是多选的)中的值
- 关于<base href="<%=basePath%>">的问题
- 使用PreparedStatement对象,往sql语句中的”?“设值,出现异常
没有getClientUsers方法
试试这个
<s:iterator value="a" var="list">
<s:iterator value="%{a}" var="list">
<s:property value="list.CUusername"/>
又或者5楼那样也可以
<s:iterator value="#request.clientUsers" var="list">
???
<td><s:property value="#list.CUusername"/></td>
<td><s:property value="#list.CUpassword"/></td>
<td><s:property value="#list.CUname"/></td>
<td><s:property value="#list.CUtime"/></td>
<td><s:property value="#list.CUre"/></td>
这里面的CUusername,CUpassword ...这些成员变量名尽量不要大写哦。
public List<ClientUserBean> getA() {
return this.clientUsers;
}public void setA(List<ClientUserBean> clientUsers) {
this.clientUsers = clientUsers;
}
改为:
public List<ClientUserBean> getClientUsers() {
return this.clientUsers;
}public void setClientUsers(List<ClientUserBean> clientUsers) {
this.clientUsers = clientUsers;
}
1、先在类里取值得地方,打印想看看,确定真的取到值了
2、看看你的jsp页面上是否导入<s:/>标签(这个很重要)
3、在类里用request.setA..().绑定一个值,然后在jsp页面显示下,确定你页面跳的是对的