java中,用session传值的问题?

java中,用session传值的问题


POPMUISE
浏览 1095回答 2
2回答

PIPIONE

把import javax.mail.Session;这行代码删了修改public static boolean checkuser(String username,String password)方法为public static boolean checkuser(String username,String password,HttpSession session)代码Session.setAttribute("username","rs.getString(username)");修改为session.setAttribute("username","rs.getString(username)");在调用checkuser方法时,在最后记得传入request.getSession()参数

慕运维8079593

你引用了2个sessionSession.setAttribute("username","rs.getString(username)");这个Session是用的javax.mail.Session应该用HttpSession
打开App,查看更多内容
随时随地看视频慕课网APP