Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session problem.....Urgent Plz

 
sachin shinde
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
sachin
 
Matthew X. Brown
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sachin shinde
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thanks
The Problem is the checkbox has given same name and i want to send the values of 'checked boxes'(ie selected boxes)
pl reply
sachin
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since it has multiple values, use the getParameterValues method.
ex. String[] CheckedBoxes = request.getParameterValues("yourParameterName")
Only the checked ones will be sent.


------------------
Bosun
SCJP for the Java� 2 Platform
 
Ashok Kulkarni
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
request.getParameterValues will be a better solution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic