解决方案 »

  1.   

    Hibernate: select goal0_.gid as gid8_, goal0_.gtitle as gtitle8_, goal0_.gddescribe as gddescribe8_, goal0_.gstarttime as gstarttime8_, goal0_.gendtime as gendtime8_, goal0_.gdays as gdays8_, goal0_.gcomplete as gcomplete8_, goal0_.pid as pid8_, goal0_.exp as exp8_ from Goal goal0_
    success   这个语句都出来了就是在jsp页面哪里不显示数据
    action  代码是public String findgoal() { UserService userService = new UserServicei();
    goal2 = (List<Goal>) userService.findgoal((List) goal2);
    // request.setAttribute("List",goal);
    System.out.println("success");
    ServletActionContext.getRequest().setAttribute("list", goal2);
    return "success";
    daoi代码 public List findgoal(List goal){
    System.out.println("UserDaoi_test");
    try {
    System.out.println("UserDaoi_try_");
    sess = HibernateUtil.getSession();
    sess.beginTransaction(); 
    String hqlString =("from Goal" ) ;
        Query query = sess.createQuery(hqlString);
              goal = query.list();

    sess.getTransaction().commit();
    } catch (Exception e) {
    e.printStackTrace();
    sess.getTransaction().rollback();
    } finally{
    HibernateUtil.closeSession();
    }
    System.out.println("daoi success");
     return   goal ;


    }
      

  2.   

    就是在按按钮之后能打印Hibernate: select goal0_.gid as gid8_, goal0_.gtitle as gtitle8_,但在对应的页面不显示要查询的数据