session:
<%
HttpSession session = request.getSession(true);
request.setAttribute("myname","gamebill");
%>
<%=request.getAttribute("myname");%>
<%
HttpSession session = request.getSession(true);
request.setAttribute("myname","gamebill");
%>
<%=request.getAttribute("myname");%>
这句话干吗用的?
request.getSession(true) //建立session
putValue("字符串变量","数据") //设定session
removeValue("字符串变量") //删除session
getValue("字符串变量") //取得session- cookie -
Cookie cookiename = new Cookie("索引值","数据")
response.addCookie(cookiename)
cookiename.getValue()
If you do not have session, create one.
HttpSession session = request.getSession(false);
If you do not have session, nothing came of it.