• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can you store ArrayList values in a session obj?

 
rex tony
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can you store ArrayList values in a session obj? Explain.
[ January 07, 2008: Message edited by: Bear Bibeault ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you be more specific? You'd store ArrayLists like any other object - there's nothing special about them.
 
zhang xuehua
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
like this:
List list = new ArrayList();//only a example,you can fill it
HttpSession session = request.getSession(true);
session.setAttribute("sunflower",list);
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"sunflower",
Please check your private messages.
 
michael duan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Zhang,but also agree Ben,the "Sunflower" should be replaced by "session" variable.
Best Wishes
--Michael
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65519
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by michael duan:
I agree with Zhang,but also agree Ben,the "Sunflower" should be replaced by "session" variable.

Huh? Any string can be the name of the scoped variable.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!