问答详情
源自:8-8 使用Cookie实现保存商品浏览记录

添加了项目,运行时出错。tomcat是8.5

严重: Servlet.service() for servlet [jsp] in context with path [/JspViewListDemo] threw exception [An exception occurred processing JSP page /details.jsp at line 106


103:                   }

104:               }

105:               Cookie cookie = new Cookie("ListViewCookie",list);

106:               response.addCookie(cookie);

107:           

108:           %>

109:           <!-- 浏览过的商品 -->



Stacktrace:] with root cause

java.lang.IllegalArgumentException: An invalid character [44] was present in the Cookie value

at org.apache.tomcat.util.http.Rfc6265CookieProcessor.validateCookieValue(Rfc6265CookieProcessor.java:182)

at org.apache.tomcat.util.http.Rfc6265CookieProcessor.generateHeader(Rfc6265CookieProcessor.java:115)

at org.apache.catalina.connector.Response.generateCookieString(Response.java:999)

at org.apache.catalina.connector.Response.addCookie(Response.java:947)

at org.apache.catalina.connector.ResponseFacade.addCookie(ResponseFacade.java:386)

at org.apache.jsp.details_jsp._jspService(details_jsp.java:236)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)

at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341)

at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)

at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Unknown Source)


提问者:寻找遗失的未来 2017-05-08 21:28

个回答

  • 轻浮与傲慢
    2017-08-03 18:17:07

    把tomcat换成7就好了


  • 慕函数4910142
    2017-06-15 16:10:08

    ,号这个分隔符无法识别,需要解码或者直接换成/,#等可识别的

  • 慕粉1454142671
    2017-05-10 13:41:54

    添加的参数list 估计有问题,是不是为空了,