• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to fetch the value of the checkbox in jsp?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

Can anybody help me out how to get the value of the checkbox value in a variable using getparameter or anything else in jsp..
The scenario is like this,I have list of data that is displayed in tabular form(row n column wise)and those data are retrived from the database only..In one column,i have check boxes corresponding to each row.So when i select check boxes(more than one),then that corresponding row values should be retrived and to be displayed in anothor page or frame.But i dont know how to retrive those values in jsp..

The code for those tabular data is like this:


Thanks in advance,
Sanat

[ November 14, 2008: Message edited by: sanat meher ]

[ November 14, 2008: Message edited by: sanat meher ]
[ November 14, 2008: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
give all the check boxes the same name and assign each one with a different value, say the rows primary key.

Use request.getParameterNames() in the servlet and you will get an array which will have only the checked values
 
Ramkumar Subburaj
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry use request.getParameterValues() insteda of request.getParameterNames
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its not a good programming practice to have all that database code in a JSP, you should be using a bean.

Are you not familiar with EL?
reply
    Bookmark Topic Watch Topic
  • New Topic