| Author |
how to get values from session in servlet
|
Vaishali Paramane
Ranch Hand
Joined: Mar 05, 2007
Posts: 106
|
|
Hi
I passed checkbox values from html to servlet and add in session attributes.
I have problem to display that values from session.
This code is for getting values from request parameter and store in session
paraName=(String)reqPara.nextElement();
session.setAttribute(paraName, request.getParameter(paraName)); // paraName is selectprod
Now I want to get values of selectprod from session
if I write
Object obj = session.getAttribute("selectprod");
it is showing length of selectprod 2 but i want to display those two values.
Please help me.
Thanks
Vaishali
|
SCJP, SCJD
Preparing for SCWCD
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26200
|
|
Vaishali,
What happens if you store the array of strings in the session and loop through that?
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Vaishali Paramane
Ranch Hand
Joined: Mar 05, 2007
Posts: 106
|
|
Thanks Jeanne
Instead of adding request parameter directly on session, first I saved in array and then getAttribute from session and its works.
thanks again
|
 |
 |
|
|
subject: how to get values from session in servlet
|
|
|