File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Multiple record updation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Multiple record updation" Watch "Multiple record updation" New topic

Multiple record updation

Venkata Sirish
Ranch Hand

Joined: Apr 09, 2007
Posts: 112
In jsp iam displaying, 100 records . Iam displaying a check box for each record. It is a delete functionality. I will check the corresponding records checkbox which are to be deleted.

How can i handle this functionality... how can i get the list of users who have been checked to be deleted, in the backend (Java Action class).

Please explain me in detail .... ASAP

Thanks in Advance,
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

"VenkataGuru Mitta",
Please check your private messages.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Schandha Ravi
Ranch Hand

Joined: Oct 20, 2007
Posts: 167
Hi Venkata,

You can always get the value of your checkbox in your controller using req.getParameter(<param name>) if this function returns "On" that means that checkbox is selected. Check for further information on these controls.

Thanks & Regards, SK
SCJP 5.0, DB2 - 800, DB2 - 803, SCDJWS (On the way)
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Well, when you want to get checkboxes, since there can be more than 1 checked, you need to be able to get back an array of those values. So you'd need something like:

String[] users = request.getParameterValues('whateverNameYouGaveTheHTMLElements');

That being said, I also noticed you mentioned "java Action class" and when I see folks say Action I think a framework might be involved. If this is true, while my suggestion above is still valid, there may be a different/easier/harder way to do it using the framework. You'll just need to let us know.

GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: Multiple record updation
It's not a secret anymore!