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

form updating using jsp

Kalai Selvi
Ranch Hand

Joined: Jan 08, 2007
Posts: 45
I am using jsp tag libraries to fetch data(11 columns) from a table and display in editable format(50 records per page) to the user. I have completed till this. Now, the user can modify any of the contents displayed on the page. After modifying the contents, he can hit save button to insert all the data on the screen to a new table.

I am confused how to read this 50 records form data using servlets or jsp.
Please help.
Qussay Najjar
Ranch Hand

Joined: Jan 18, 2008
Posts: 53
Hi Kalai,
As you're using a loop in your jsp page to create each record, and you're creating 50 records, so you have in your generated html page
for example (50 field with the name "employeeName", 50 field with the name "ID", ....), right?
so when you want to retrieve the values of those fields all you'll get is the last value set only..
so in order to trick this do this:
1- In your jsp page and while naming your fields write it like that:

now you have numbered fields in your generated html page:
-For record 1 --> employeeName1, ID1, ....
-For record 2 --> employeeName2, ID2, ....

2- In your servlet that is supposed to save those records just let it do the next:

and that's it..
I've done it before and it worked for me,
for more details just inform me please..

I agree. Here's the link:
subject: form updating using jsp
It's not a secret anymore!