为了账号安全,请及时绑定邮箱和手机立即绑定

添加了项目,运行时出错。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)


正在回答

3 回答

把tomcat换成7就好了


0 回复 有任何疑惑可以回复我~

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

1 回复 有任何疑惑可以回复我~
#1

轻浮与傲慢

你哪看到是分隔符的问题了?
2017-08-03 回复 有任何疑惑可以回复我~
#2

慕函数4910142 回复 轻浮与傲慢

这个就是解码问题,我修改了就可以了
2017-08-11 回复 有任何疑惑可以回复我~

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

0 回复 有任何疑惑可以回复我~
#1

qq_星尘_8 回复 寻找遗失的未来 提问者

添加cookie的时候要用URLEncoder.encode(list, "utf-8")编码,取出来用URLDecoder.decode(c.getValue(),"utf-8")解码,我的也是8.5
2017-05-16 回复 有任何疑惑可以回复我~
#2

寻找遗失的未来 提问者 回复 qq_星尘_8

好的我试试
2017-05-17 回复 有任何疑惑可以回复我~
#3

ices_ 回复 qq_星尘_8

URLDecoder cannot be resolved请问这个怎么解决
2017-11-19 回复 有任何疑惑可以回复我~
#4

忧伤的民工 回复 qq_星尘_8

具体怎么改的呢?
2018-05-26 回复 有任何疑惑可以回复我~
查看2条回复

举报

0/150
提交
取消

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

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信