This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JSP and the fly likes session problem.....Urgent Plz Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "session problem.....Urgent Plz" Watch "session problem.....Urgent Plz" New topic

session problem.....Urgent Plz

sachin shinde

Joined: Jul 05, 2001
Posts: 27
HI friends,
I have one small problem
I have a set of check box and
I want to pass checked values thro session to next page.
And how to retrive that values in next page.
PL it's urgent,
waiting for reply.
Matthew X. Brown
Ranch Hand

Joined: Nov 08, 2000
Posts: 165
I'm not sure how your structuring everything in your web server- but an easy way is to append it to the url- via appending the checkbox value in the url. Look at the URL on this page- there should be some values in their. So basically on submit of your page with a checkbox on it- you have a servlet that picks up the checkbox value and other values, you do a redirect to your next page, appending to the redirect URL the value of the checkbox. Another way you can do it is via javabeans. However, this is more involved. Can you give some more info on what you have so far?
vivek sivakumar
Ranch Hand

Joined: Aug 09, 2001
Posts: 187
im sure ur check box will have a value so on submitting u can get the value of the checkbox by request.GetParameter("value");
where value= specified by you if its checked for ex (0) and not checked for ex ("1"), hope this helps.

SCJP, SCWD <br />A farmer learns more from a bad harvest than a good one.
sachin shinde

Joined: Jul 05, 2001
Posts: 27
The Problem is the checkbox has given same name and i want to send the values of 'checked boxes'(ie selected boxes)
pl reply
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Since it has multiple values, use the getParameterValues method.
ex. String[] CheckedBoxes = request.getParameterValues("yourParameterName")
Only the checked ones will be sent.

SCJP for the Java� 2 Platform

So much trouble in the world -- Bob Marley
Ashok Kulkarni

Joined: Nov 18, 2003
Posts: 4
Hi i have n number of check boxes in jsp, i have assigned ids for each checkbox
i want check which one is selected and catch the values of checked ones
in servlet.can any one give soln for this..plsss
Vineet Menghani

Joined: Sep 04, 2003
Posts: 3
request.getParameterValues will be a better solution.
I agree. Here's the link:
subject: session problem.....Urgent Plz
It's not a secret anymore!