在做ssh整合-----------遇到问题
DAO实现类具体方法:public Collection<Users> selectUsers() {
Collection<Users> users = this.getHibernateTemplate().find("FROM Users");
return users;
}
测试类:public class testuser_serviec_price {
public static void main(String[] args) throws ParseException {
ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
IUserDao dao= (IUserDao) ctx.getBean("userDao");
Collection<Users> ps = dao.selectUsers();
for(Users p : ps){
System.out.println(p);
}
}
}
users表具体数据:insert into users(name,loginname,loginpassword,status,enrolldate,paymenttype,sex) values("xuan","123","123",1,"2009-07-26",123,"000");
commit;
控制台输出:oss.user.pojo.Users@c72243
为什么不是遍历出[xuan,123,123,1,2009-07-26,123,000]
请问出现javax.servlet.ServletException: java.lang.NoSuchMethodException: Action[/acct] does not contain specified method (check logs)错误是什么原因呢
我检查过我的action中的调用方法名没有错,方法也是public的,参数排列也是(ActionMapping actionMapping,ActionForm actionForm, HttpServletRequest request,HttpServletResponse response)
找不出问题啊 头大了
System.out.println(p);
}
应改为
System.out.println(p.getLoginname());
System.out.println(p.getLoginpassword());
System.out.println(p.getStatus());
.......
System.out.println(p);
}
应改为
System.out.println(p.getLoginname());
System.out.println(p.getLoginpassword());
System.out.println(p.getStatus());
.......
然后........