//String str = URLEncoder.encode(request.getParameter("name"),"utf-8");
Cookie name = new Cookie("name","tests");
Cookie names = new Cookie("name","test");
response.addCookie(name);
response.addCookie(names);
Cookie cookie = null ;
Cookie[] cookies = null;
cookies = request.getCookies();
for(int i=0;i
cookie = cookies[i];
out.println(cookie.getName() + " : " + cookie.getValue());
}
%>
你在jsp中加入这段代码 看看页面输出是什么 就可以知道你 这个问题的答案了 。
我就不直接告诉你了