String saveCode = (String)req.getSession().getAttribute(“code”);
在使用这个方法的时候
需要在你想找的code的页面写上
HttpSession session= req.getSession();
session.setAttribute(“code”,code);
不然会赋值为null
使用req.getSession().getAttribute("code");的时候会出现的一些小问题
最新推荐文章于 2024-05-20 12:26:00 发布