参考资料:

  http://www.blogjava.net/persister/archive/2009/10/02/297103.html

  http://blog.csdn.net/xiaozhengdong/article/details/7499020

  http://www.blogjava.net/andy-huang/articles/base64.html

在创建Cookie的时候不能直接写入中文,如果要的话,需要进行转码。如果你手头有BASE64Encoder和BASE64Decoder的API的话,如下:

public static String encryptBASE64(byte[] key) throws Exception

public static byte[] decryptBASE64(String key) throws Exception

对你要写的字符串进行编码解码即可。sun.misc的Base64类不建议使用(我这里根本找不到这个类)。

使用Cookie报错Control character in cookie value, consider BASE64 encoding your value的更多相关文章

  1. cookie遇到java.lang.IllegalArgumentException: Control character in cookie value or attribute

    java.lang.IllegalArgumentException: Control character in cookie value or attribute. 该异常说明cookie中的val ...

  2. Cookie存储中文报错:java.lang.IllegalArgumentException: Control character in cookie value or attribute.(转)

    项目中做自动登录和保存密码时,Cookie报错Java.lang.IllegalArgumentException,上google查了下 在http://hi.baidu.com/xtxycy/blo ...

  3. Control character in cookie value, consider BASE64 encoding your value , java操作cookie遇到中文会报错的解决方案

    项目当中用到cookie保存中文,但是会报如下错误: Control character in cookie value, consider BASE64 encoding your value 大概 ...

  4. tomcat使用cookies缓存的时候中文报错解决办法 java.lang.IllegalArgumentException: Control character in cookie value or attribute.

    报错出现 java.lang.IllegalArgumentException: Control character in cookie value or attribute. at org.apac ...

  5. Control character in cookie value, consider BASE64 encoding your value-Cookie保存中文出错[转]

    项目当中用到cookie保存中文,但是会报如下错误: Control character in cookie value, consider BASE64 encoding your value 大概 ...

  6. 解决Tomcat的IllegalArgumentException: Control character in cookie value or attribute错误

    接口中带有中文,tomcat8 17-Apr-2019 13:21:23.734 严重 [http-nio-8082-exec-2] org.apache.coyote.http11.Abstract ...

  7. 异常:java.lang.IllegalArgumentException: Control character in cookie value or attribute.

    后台提示: 严重: Error processing requestjava.lang.IllegalArgumentException: Control character in cookie va ...

  8. HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: Control character in cookie value or attribute.

    HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: ...

  9. 创建Cookie抛出异常:java.lang.IllegalArgumentException: Control character in cookie value

    调用Cookie对象的构造函数可以创建Cookie.Cookie对象的构造函数有两个字符串参数:Cookie名字和Cookie值.   名字和值都不能包含空白字符以及下列字符:[ ] ( ) < ...

随机推荐

  1. Java 命名小技巧

    存储信息: xxxStorage 映射: xxxMapping 通过参数获取某个对象: getxxxFor 处理器: xxxHanlder handle 检索: xxxretriever 验证器: x ...

  2. Fisheye projections from spherical maps [转]

    Fisheye projections from spherical maps Written by Paul Bourke May 2003, software updated January 20 ...

  3. 自定义崩溃界面 CustomActivityOnCrash

    项目地址:https://github.com/Ereza/CustomActivityOnCrash The inner workings are based on ACRA's dialog re ...

  4. mssql Sqlver 修改标识列方法

    摘自: http://www.cnblogs.com/badboy2008/articles/1145465.html MSSQL Server修改标识列方法   ----允许对系统表进行更新exec ...

  5. shiro 授权介绍

    授权即访问控制,它将判断用户在应用程序中对资源是否拥有相应的访问权限.如,判断一个用户有查看页面的权限,编辑数据的权限,拥有某一按钮的权限,以及是否拥有打印的权限等等. 一.授权的三要素 授权有着三个 ...

  6. MapReduce中的分布式缓存使用

    MapReduce中的分布式缓存使用 @(Hadoop) 简介 DistributedCache是Hadoop为MapReduce框架提供的一种分布式缓存机制,它会将需要缓存的文件分发到各个执行任务的 ...

  7. [Functional Programming] Write simple Semigroups type

    An introduction to concatting items via the formal Semi-group interface. Semi-groups are simply a ty ...

  8. [ES6] 05. The leg keyword -- 3. Block Scope

    In ES6, IIFE is not necessary: // IIFE写法 (function () { var tmp = ...; ... }()); // 块级作用域写法 { let tm ...

  9. 如何知道TSQL语句已经运行了多久

    如何知道TSQL语句已经运行了多久 ,) --millisecond per tick --如果datediff 函数导致溢出 把下面的millisecond改为second 毫秒改为秒 SELECT ...

  10. 解决ssh登录Host key verification failed

    使用SSH登录某台机器,有时因为server端的一些变动,会出现以下信息: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @    WARNING: R ...