81,092
社区成员
发帖
与我相关
我的任务
分享
public Information findInformation(int userId){
List list=new ArrayList<Information>();
HibernateTemplate ht=new HibernateTemplate(this.sf);
System.out.println("userId:"+userId);
list=ht.find("from Information where userId="+userId);
Information info=(Information)list.get(0);
System.out.println("用户真实姓名:"+info.getInfoName());//此处可以获取值
return info;
}
public String loginBlogs(){
ubdi.findInformation(ub.getUserId());
Information info=new Information();
System.out.println("信息:"+info.getInfoName());//此处不可以获取值
return "blogsok";
}
public String loginBlogs(){
//ubdi.findInformation(ub.getUserId());
//Information info=new Information();
Information info=ubdi.findInformation(ub.getUserId()); System.out.println("信息:"+info.getInfoName());//此处不可以获取值
return "blogsok";
}
这样应该就可以取到值了