daoImplpublic 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;
}actionpublic String loginBlogs(){
ubdi.findInformation(ub.getUserId());
Information info=new Information();
System.out.println("信息:"+info.getInfoName());//此处不可以获取值
return "blogsok";
}
请大侠帮忙怎么在action中获取这个值,需要把值放入map所以才需要获取
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;
}actionpublic String loginBlogs(){
ubdi.findInformation(ub.getUserId());
Information info=new Information();
System.out.println("信息:"+info.getInfoName());//此处不可以获取值
return "blogsok";
}
请大侠帮忙怎么在action中获取这个值,需要把值放入map所以才需要获取
解决方案 »
- 为什么用迅雷下载xls格式的文件,最后会变成html格式的,但是如果用ie下载,就很正常了!!求解!!
- 请大家给推荐一个捕获HTTP信息工具
- java.lang.ClassNotFoundException: org.springframework.web.filter.CharacterEncodingFilter
- Struts2中,能否让<s:textfield>文本框内的内容居中显示??
- 请问这是什么错
- Ajax问题求助
- [求救!]“[Microsoft][ODBC Microsoft Access Driver] 客户端的工作过多”的问题
- 急需做网站高手,最好是大连的,价钱可商议
- 一个跳转菜单的问题!很急呀!在线等各位大哥的解决方法!
- 熟悉javamail和s/mime的高手请进,如何用javamail发送如内格式的邮件??
- 关于struts2页面跳转问题
- EL 和OGNL 分不清了。。。
放在
ubdi.findInformation(ub.getUserId());
前面?
Information info = new Information();
info = ubdi.findInformation(ub.getUserId());
//ubdi.findInformation(ub.getUserId());
//Information info=new Information();
Information info=ubdi.findInformation(ub.getUserId()); System.out.println("信息:"+info.getInfoName());//此处不可以获取值
return "blogsok";
}
这样应该就可以取到值了
这样也不行我试过了,得到的时null