<a href='http://localhost:8080/"+request.getContextPath()+"/servlet/BuySession?name="+s+"'>购买</a>加了http://localhost之后,发现别的Servlet取不到Session对象了,浏览器没有关闭。
难道是加了http;//localhost之后就等同于重新开一个浏览器啊?
<a href='http://localhost:8080/"+request.getContextPath()+"/servlet/BuySessionname="+s+"'> 路径问题,request.getContextPath()获取的值前面已经是“/”+“你的项目名称“
改成
<a href='http://localhost:8080"+request.getContextPath()+"/servlet/BuySession?name="+s+"'>
  相关解决方案