tomcat7.0 cookie存中文信息出错
2015-04-17 11:15
351 查看
用中文用户名保存到cookie中出错
异常:java.lang.IllegalArgumentException: Control character in cookie value or attribute.
解决方法
String username=request.getParameter("username")
另外:username如果乱码有可能是因为表单没有添加:method="POST"
异常:java.lang.IllegalArgumentException: Control character in cookie value or attribute.
解决方法
String username=request.getParameter("username")
if(cookie.getName().equals(username)){ //使用cookie时解码 String usrname=URLDecoder.decode(cookie.getValue(),"utf-8");
}
}
另外:username如果乱码有可能是因为表单没有添加:method="POST"
相关文章推荐
- 【javaweb:cookie】注意Tomcat8.5及以上支持中文cookie,Tomcat7.0不支持中文cookie
- tomcat 解析包含中文的cookie 抛警告源码分析
- Tomcat学习笔记 - 错误日志 - NetBeans配置tomcat出错情况总结 -- 尚未授予访问 Tomcat 服务器的权限。请在服务器管理器的 Tomcat 定制器中设置 "manager-script" 角色的正确用户名和口令。 有关详细信息, 请查看服务器日志。
- 删除tomcat7.0的server文件夹出错
- Control character in cookie value, consider BASE64 encoding your value-Cookie保存中文出错[转]
- 如何用Cookie存储中文信息
- tomcat 编码设置 成中文utf-8编码 保证参数为中文时 不出错
- 在ASP.NET不同版本间保存中文信息到Cookie中的差异
- Tomcat7中的Cookie存入中文导致IllegalArgumentException异常
- 让tomcat支持中文cookie
- tomcat服务器运行Cookie时出错
- tomcat的安全配置(禁用http方法,部署多个应用,启用从安全cookie,指定错误页面和显示信息)
- Tomcat使用startup启动,一闪而过,如何查看出错信息
- Tomcat7 jsp解决Cookie中文乱码
- 升级tomcat7到tomcat8解决cookie中文问题添加配置项
- solr 7.0 tomcat 安装配置 + 中文分词
- 系统架构之Tomcat7不支持中文cookie
- JSP+servlet+cookie中的表单中文乱码出错的解决方案
- Tomcat中用Filter解决JSP提交中文信息到Servlet的乱码问题
- 关于tomcat7服务下面js无法获取JSESSIONID的cookie信息