private Cpinfo entity; @SuppressWarnings("unchecked")
public void setCpList(List cpList) {
this.cpList = cpList;
} @SuppressWarnings("unchecked")
public List getCpList() {
return cpList;
} // find
@SuppressWarnings("unchecked")
public String cpFindByid() throws Exception {
setCpList((List) serivce.find(entity));
System.out.println(cpList.size());//注这里控制台可以显示出结果,也就是有数据,而页面没有
return "rs";
}
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head> <title>My JSP 'find.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page"> </head> <body>
<s:iterator value="#request.cpList" id="cp">
<li>
<s:property value="#cp.name" />
</li>
<li>
<s:property value="#cp.info" />
</li>
<li>
<s:property value="#cp.title" />
</li>
<li>
<a href='cpdel?entity.id=<s:property value="#cp.id" />'>删除 </a>
</li>
<li>
<a href='cpFindByid?entity.id=<s:property value="#cp.id" />'>修改</a>
</li>
</s:iterator> </body>
</html>
Dao层代码 不知道和类型有关系没
@SuppressWarnings("unchecked")
public List find(Object entity) {
return this.findByExample(entity);
}不知道问题在哪里
JSP页面代码 应该也没错好像 我可以用他查询出 所有数据不知道现在什么问题了郁闷
public void setCpList(List cpList) {
this.cpList = cpList;
} @SuppressWarnings("unchecked")
public List getCpList() {
return cpList;
} // find
@SuppressWarnings("unchecked")
public String cpFindByid() throws Exception {
setCpList((List) serivce.find(entity));
System.out.println(cpList.size());//注这里控制台可以显示出结果,也就是有数据,而页面没有
return "rs";
}
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head> <title>My JSP 'find.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page"> </head> <body>
<s:iterator value="#request.cpList" id="cp">
<li>
<s:property value="#cp.name" />
</li>
<li>
<s:property value="#cp.info" />
</li>
<li>
<s:property value="#cp.title" />
</li>
<li>
<a href='cpdel?entity.id=<s:property value="#cp.id" />'>删除 </a>
</li>
<li>
<a href='cpFindByid?entity.id=<s:property value="#cp.id" />'>修改</a>
</li>
</s:iterator> </body>
</html>
Dao层代码 不知道和类型有关系没
@SuppressWarnings("unchecked")
public List find(Object entity) {
return this.findByExample(entity);
}不知道问题在哪里
JSP页面代码 应该也没错好像 我可以用他查询出 所有数据不知道现在什么问题了郁闷
解决方案 »
- flexpaper问题
- 关于user-agent 只有一小段的问题
- 初学java web-一个框架逻辑处理,查询处理表单
- structs2 中使用el表达式和ognl表达式获得后台实体类中的List值失败
- weblogic9.2不能解析el表达式?
- spring2.5+struts2 整合多模块开发问题,spring配置文件中bean重名的问题
- XML错误
- 急求:有没有用jsp写的blog的open source
- 求高人进来看看这个问题,本人刚入门,不太懂。求教
- 关于WSDL的问题,求助,求助,求助,求助!!!!!!!!!!!!
- 用JDBC连sqlserver2000出错,但是用MySQL连的时候没有问题
- 急。。远程调用webservice
<s:iterator value="cpList" id="cp"><s:property value="name" />这样不简单些吗?你把cp前的"#"号去掉,试一下.