String saveCode = (String)req.getSession().getAttribute(“code”);
在使用這個方法的時候
需要在你想找的code的頁面寫上
HttpSession session= req.getSession();
session.setAttribute(“code”,code);
不然會指派為null
String saveCode = (String)req.getSession().getAttribute(“code”);
在使用這個方法的時候
需要在你想找的code的頁面寫上
HttpSession session= req.getSession();
session.setAttribute(“code”,code);
不然會指派為null