天天看點

使用req.getSession().getAttribute("code");的時候會出現的一些小問題

String saveCode = (String)req.getSession().getAttribute(“code”);

在使用這個方法的時候

需要在你想找的code的頁面寫上

HttpSession session= req.getSession();

session.setAttribute(“code”,code);

不然會指派為null