ac.getSession().put("Owner", owner);你都注释了 怎么显示
除了表色标注的都可以显示??那就是查询的问题 或者数据库表中本身没有数据
除了表色标注的都可以显示??那就是查询的问题 或者数据库表中本身没有数据
解决方案 »
- struts2+spring整合之i18n问题
- 求教jFreeChart
- java如何调用vb.net的dll?
- 如何配置tomcat+ActiveMQ?(希望能够提供详细配置)
- 求大神解答,在struts2的拦截器中 ,怎么获取当前action中的ActionError呢
- 报表引擎进行开源公布
- 在Eclipse中启动Jboss出错。请各位帮忙看看。江湖救急啊!
- 启动resin + struts后出来exception???
- 参与有分
- 初学java,请问Jsp和J2ee有什么关系,呵呵,简单问题
- java.lang.NoClassDefFoundError: Could not initialize class com.aw.dao.HibernateU
- post请求下载excel文件
public class OwnerServiceImp implements OwnerService { private EntityDao entityDao;
//业主登陆
public String owner_Login(Owner owner) {
// TODO Auto-generated method stub
System.out.println("进入登录.....");
String view="Tourists";
String hql="from Owner where ownerName='"+owner.getOwnerName()+"' and ownerTel='"+owner.getOwnerTel()+"'";
//强制类型转换
List<Owner> list= find(hql);
if(list.size()>0)
{
view="Owner";
owner=list.get(0);
System.out.println(owner.getOwnerGender()+owner.getOwnerIdcard()+owner.getOwnerRoom()+owner.getOwnerWork());
ActionContext ac=ActionContext.getContext();//保存session,相当于request.getSession().setAttribute("listMessage",listMessage);
System.out.println(owner);
ac.getSession().put("Owner", owner);
}
else{
view = "error";
ActionContext ac=ActionContext.getContext();
ac.getSession().put("errorinfo","业主不存在!");
} return view;
}
//把查找的结果进行强制类型转换
public List<Owner> find(String hql) {
// TODO Auto-generated method stub
List<Owner> list = new ArrayList<Owner>();
for(Object o:entityDao.find(hql)){
list.add((Owner)o);
}
return list;
}
public EntityDao getEntityDao() {
return entityDao;
}
public void setEntityDao(EntityDao entityDao) {
this.entityDao = entityDao;
} public List<Owner> findo(String hql) {
// TODO Auto-generated method stub
List<Owner> list= new ArrayList<Owner>();;
for(Object o:entityDao.find(hql))
{
list.add((Owner)o);
}
return list;
}
}