Results 1 to 2 of 2
Thread: sessions
- 05-17-2011, 10:48 AM #1
Member
- Join Date
- Jun 2010
- Posts
- 25
- Rep Power
- 0
sessions
hi ,
could you explain me how we can set session attributes and how we can retrieve those values in other page.
HttpSession hs = req.getSession(true);
what is the use of above line.
and if req.getSession(false);what will happen.
in one action class i am getting the list values from DB and i am settinng list values into session like below.
hs.setAttribute("list",list);
then in another jsp page i need to retrieve this list.for this simply if we give like below means
List sample=hs.getAttribute("list"); now is it list values will come?
or we need to check again HttpSession hs = req.getSession(true);
then after only will get.
please suggest me in thisThanks&Regards,
Muralikrishna K
- 05-17-2011, 11:56 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
The API is your friend.
That's not how you get session attributes in a JSP.
That's what the usebean tag is for.
Similar Threads
-
Sessions
By Billywizz in forum New To JavaReplies: 1Last Post: 03-28-2011, 08:53 PM -
sessions doubt
By anilarava in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 11-16-2010, 01:22 PM -
Kill sessions
By Subscribe.name in forum Java ServletReplies: 1Last Post: 10-05-2009, 10:22 PM -
Sessions in jsp
By Ed in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 07-02-2007, 03:46 PM -
sessions in jsp
By Heather in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 06-30-2007, 03:44 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks