Hi Yogesh,
 
    It looks like you need the TOKEN functionality.  I don't know if the token functionality is available in 0.5.  You will need to look at the source code for the saveToken( request ) method.  You might be able to mimic the functionality in 0.5 by rebuilding the code. 
 
You will need an action object to call saveToken( ) before displaying the form.  The in the Action object that does the actual insert you will need to
call isTokenValid( request ) to see if you should perform the update.  If the token is valid call resetToken(request) and do you insert.  If the user tries to submit again the isTokenValid(request) will return false.
 
Hope This Helps,
Abraham
-----Original Message-----
From: yogesh kapoor [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 01, 2001 9:39 AM
To: [EMAIL PROTECTED]
Subject: 2 Problems


Hi All,

               I am using struts framework(release 0.5) for developing my web application(with Jrun-3.0 and Netscape Enterprise Server-3.6). I am facing 2 problems and hape that some one out there would definetly have answers to them.here are they.....

1)Just like we use actionbase and actionform beans in struts , i am also using one 'Open Actionbase Bean' and one 'Save Actionbase Bean' to open and save my forms. While saving the form using 'Save Actionbase Bean' i call 'Open Actionbase Bean' from within the 'Save Actionbase Bean' to show the inserted/updated  form back to the user. But now after saving the form and displaying it back, if i do a reload of the page, the insert and update operation get performed again(which should not happen). So i have inserted a new record and do the reload then a duplicate record gets inserted into my table.How can i avoid this to happen?

2)I am using a customized jdbc api, which allows only one resultset and one statement object per connection object.I have a page(with two frames) where i accept some search criteria from the user(on the top frame) , do the search in the database and display the list of records found in bottom frame.But the problerm occurs when the user hits the search button multiple times , as in that case i receive an exception because my api allows only one resultset object open .I am making the database call in an Actionbase Bean. But i am not able to figure out that when a user hits the search(submit) button multiple times(say twice) how much my first request had progressed before getting terminated. Can i find this in any way , so that i can close my JDBC objetcs before the next request starts executing.

Thanks in advance,

Regards,

Yogesh



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Reply via email to