public class AdminTeacherAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
HttpSession httpSession = request.getSession();
String hql = null;
List tlist = new ArrayList();
Transaction tx = null;
Teacher teacher=null;
Object obj=null;
hql = "from Teacher t";
try {

tlist = HibernateService.execQuery(hql);

} catch (Exception e) {
e.printStackTrace();
tx.rollback();
}
    
httpSession.setAttribute("teacherlist", tlist);
return mapping.getInputForward();
}
}上面的hql中我这样写:select id,t_id,pwd,t_name from Teacher就出现空指针的错误,以前我这样写都没有错!
现在我这样写from Teacher就行了,就这个小问题,我想搞懂!