使用这句话的前提是在教师用户登录成功时request.getSession().setAttribute("user","teacherUser");
意思是将登录成功的用户信息保存到session中,方便使用,比如需要显示登录用户信息时。
此处就是取用先前保存在session中的教师信息,以Teacher对象实体的方式。
用setAttribute()才能getAttribute()到信息。
意思是将登录成功的用户信息保问存到session中,方便使用,比如需要显示登录用户信息时答。
此处就是取用先前保存在session中的版教师信息,以Teacher对象实体的方式。
用setAttribute()才能getAttribute()到信权息。