日期:2014-05-19  浏览次数:20860 次

ssh整合后 actionForm取不到值
在整合了struts + hibernate +spring 后,
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
LoginForm login=(LoginForm)form;
String forward="false"; 

`if(user_bean.loginUser(login)){
forward="true";
}
return mapping.findForward(forward);
}
取到的是空的值。

------解决方案--------------------
哈哈,我说我见鬼了,终于有人和我一样了,前天我也是,我其他的actionForm都能用,就最后一个不能用,害的我弄了一天都没弄出来,最后本人急着交项目了就用request.getParameter("")来获取的参数。还有我的配置是对的哈,你看看你的struts-config.xml里面的action节点的name属性和<form-bean>配置没有……希望你和我的问题不一样哈,不然痛苦的很……
------解决方案--------------------
探讨
在整合了struts + hibernate +spring 后,
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub……

------解决方案--------------------
看下structs配置,确定那里面的getter setter方法是否与界面属性对应啊。