session:
<% 
HttpSession session = request.getSession(true);
request.setAttribute("myname","gamebill"); 
%> 
<%=request.getAttribute("myname");%>

解决方案 »

  1.   

    HttpSession session = request.getSession(true); 
    这句话干吗用的?
      

  2.   

    - session -
    request.getSession(true) //建立session
    putValue("字符串变量","数据") //设定session
    removeValue("字符串变量") //删除session
    getValue("字符串变量") //取得session- cookie -
    Cookie cookiename = new Cookie("索引值","数据")
    response.addCookie(cookiename)
    cookiename.getValue()
      

  3.   

    Justin(兰色梧桐) 你的方法好象出错
      

  4.   

    HttpSession session = request.getSession(true); 
    If you do not have session, create one.
    HttpSession session = request.getSession(false); 
    If you do not have session, nothing came of it.