严重: Servlet.service() for servlet [jsp] in context with path [/JspViewListDemo] threw exception [An exception occurred processing [details.jsp] at line [70]
67: }68: }
69: Cookie cookie = new Cookie("ListViewCookie",list);
70: response.addCookie(cookie);
71:
72: %>
73: <!-- 浏览过的商品 -->
Stacktrace:] with root cause
java.lang.IllegalArgumentException: An invalid character [44] was present in the Cookie value
https://www.imooc.com/qadetail/177191
list+=request.getParameter("id")+"#";
//如果浏览记录超过1000条,清零.
String[] arr = list.split("#");
if(arr!=null&&arr.length>0)
{
if(arr.length>=1000)
{
list="";
}
}
Cookie cookie = new Cookie("ListViewCookie",list);
response.addCookie(cookie);
将逗号,换成#,记得itemdao的方法也是
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦