| Author |
database and servlets
|
Yell Srik
Ranch Hand
Joined: Mar 10, 2004
Posts: 61
|
|
Hi, i have created a servlet page which contains a HTML form. the form has many fields. once the user enters the values and clicks on a 'save' button, these values are stored in the database. now i close the browser. after some time, when i open the servlet in the browser, i want the last set of saved values to the shown in the form.. is it possible?? and if yes, how can it be done??? thanks in advance
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
Yes. Depending on what you mean by "last saved" you can either load the record from the DB with the highest PK (or perhaps a modify timestamp field - if you also want to show last updated, as well as last created), or hold the last saved PK in the user's session and reload it. If however you are closing the browser (and so ending the session) and you want the last saved to be reshown, you'll need to save the last saved record PK with a user record, if one exists.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Yell Srik
Ranch Hand
Joined: Mar 10, 2004
Posts: 61
|
|
Hi paul, thanks for the reply.actually i want the last saved record to be reshown. can u give me some sort of code snippet to help me proceed further..
|
 |
Jeroen Wenting
Ranch Hand
Joined: Oct 12, 2000
Posts: 5093
|
|
|
read about cookies. That's all the hint you should need.
|
42
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
|
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: database and servlets
|
|
|