File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSP Help!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Help!!" Watch "JSP Help!!" New topic
Author

JSP Help!!

Barun Saha
Greenhorn

Joined: Nov 10, 2003
Posts: 24
I have a form to upload a file. I am using multipart request in the form. Here is my problem. My screen is like this.
Record1 [Modify][Delete]
Record2 [Modify][Delete]
Record3 [Modify][Delete]
.....
.....
For Each Record, I have a modify/delete button. The problem is, when I press the delete/modify button, I always get the last resultset values. Both modify & Delete are Submit type buttons.
Please help, since I am really stuck
Thanks,
zimby
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

Welcome to the Ranch Zimby!
You'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Thanks!
bear
JSP Forum Bartender
[ January 12, 2004: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

Now with regards to your question: I don't think anyone is going to be able to help you given the meager info you've supplied.
How are your buttons wired? What does the database manipulation code look like? How are you matching up the records on the page to the records in the DB?
When posting code, please be sure to use the UBB code tags to preserve the formatting of the code.
bear
Barun Saha
Greenhorn

Joined: Nov 10, 2003
Posts: 24
Code is in the following sequence.
while(rs.next()) {
<form action="qos.jsp" name="form" method="post" class = "form" enctype="multipart/form-data">
<td width="24"><%=rs.getString("unique_id")%>
<input type="hidden" name="uid" value=""<%=rs.getString("unique_id")%>">
</td>
<td colspan="2" width="159">
<input type="submit" name="submit" value="Modify" size="10">
<input type="hidden" name="uniid" value="<%=u%>">
<input type="submit" name="submit" value="Delete" size="10">
<input type="hidden" name="uniid" value="<%=u%>">
</td>
</tr>
Value of u = unique_id
I have tried to have the form feed to itself, or to another jsp. I use multipart request methords - getParameter to get the values from the original jsp, but the value is always the last row.
You can suggest a better way to do this.
Thanks,
zimby
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

First basic question: why the multi-part form?
Barun Saha
Greenhorn

Joined: Nov 10, 2003
Posts: 24
Well, for each row, there is a file attachment that I upload into my unix box. I use the package oreilly.servlet.MultipartRequest.
Thanks,
Zimby
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Help!!