首页 新闻 会员 周边 捐助

java中设置cookie

0
悬赏园豆:5 [已解决问题] 解决于 2022-07-20 15:31

场景:想在cookie中保存一个list<object> 类型的对像,但是cookie中只能存string,我要怎么才能将对象放进去并且取出来以后还是这个对象的类型

sunny-JJ的主页 sunny-JJ | 初学一级 | 园豆:-3
提问于:2022-07-20 09:53
< >
分享
最佳答案
1

可以先把list转换成 JSONarray 再转成string,反之 string转换成 JSONArray再转成list

收获园豆:3
头大的小武 | 菜鸟二级 |园豆:205 | 2022-07-20 10:35
其他回答(2)
0

The rising number of occupations and the more elevated levels of interest, especially in the IT area, is expected to some degree to the quick and to some degree constrained beginning of computerized change that numerous areas needed to go through in the pandemic. The IT area itself became by 18% month-on-month. The Naukri report said, "This exhibits that undertakings are effectively driving their recuperation endeavors and driving development with computerized change at the middle."
Java Course in Pune

Java Classes in Pune

surbhinahta | 园豆:216 (菜鸟二级) | 2022-07-20 13:46
1

也可以把 ”list<object> 类型的对像“ 这个序列化一下保存在cookie 中,使用的时候然后再反序列化出来就好了

收获园豆:2
lanwf | 园豆:208 (菜鸟二级) | 2022-07-20 14:36
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册