HTTP Status 500 - Request processing failed; …
2018-06-18 02:04:35来源:未知 阅读 ()
1 HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: Control character in cookie value or attribute. 2 type Exception report 3 4 message Request processing failed; nested exception is java.lang.IllegalArgumentException: Control character in cookie value or attribute. 5 6 description The server encountered an internal error that prevented it from fulfilling this request. 7 8 exception 9 10 org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: Control character in cookie value or attribute. 11 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982) 12 org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) 13 javax.servlet.http.HttpServlet.service(HttpServlet.java:650) 14 org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) 15 javax.servlet.http.HttpServlet.service(HttpServlet.java:731) 16 org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 17 org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) 18 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) 19 root cause 20 21 java.lang.IllegalArgumentException: Control character in cookie value or attribute. 22 org.apache.tomcat.util.http.CookieSupport.isHttpSeparator(CookieSupport.java:205) 23 org.apache.tomcat.util.http.CookieSupport.isHttpToken(CookieSupport.java:229) 24 org.apache.tomcat.util.http.ServerCookie.appendCookieValue(ServerCookie.java:185) 25 org.apache.catalina.connector.Response.generateCookieString(Response.java:1054) 26 org.apache.catalina.connector.Response.addCookie(Response.java:996) 27 org.apache.catalina.connector.ResponseFacade.addCookie(ResponseFacade.java:380) 28 admin.membersheep.hk.Controller.HomeController.Login(HomeController.java:327) 29 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 30 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 31 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 32 java.lang.reflect.Method.invoke(Method.java:498) 33 org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:220) 34 org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:134) 35 org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116) 36 org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) 37 org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) 38 org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) 39 org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) 40 org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) 41 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) 42 org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) 43 javax.servlet.http.HttpServlet.service(HttpServlet.java:650) 44 org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) 45 javax.servlet.http.HttpServlet.service(HttpServlet.java:731) 46 org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 47 org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) 48 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) 49 note The full stack trace of the root cause is available in the Apache Tomcat/7.0.85 logs.
IllegalArgumentException此异常表明向方法传递了一个不合法或不正确的参数
注意Control character in cookie value or attribute 这个才是重点
问题说明Cookie编码格式错误
解决办法cookie存储值是指明utf8国际编码格式
如
javax.servlet.http.Cookie realCookie = new javax.servlet.http.Cookie(java.net.URLEncoder.encode(temp.getName(),"utf8"),java.net.URLEncoder.encode(temp.getValue(),"utf8"));
未经同意请勿转载!!!
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
下一篇:javaee 学习(一)
- 面试官:用了HTTPS安全了吗?用HTTPS会被抓包吗?我回答不上 2020-06-06
- 500 ZuulException: Forwarding error 2020-06-01
- httpclient 5.0 设置超时时间 2020-05-28
- 简单了解 HTTP 协议 2020-05-20
- Tomcat视角看一次http请求 2020-05-18
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash