• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reloading the page data

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys,

I just want to clarify something. In my jsp page, I have a grid where all records are displayed.
Each row corresponds to one record. When I wanna edit a certain record, I will have to click
a radio button (the radio button carries the value of the username, which is unique), and click edit.
I will then be redirected to the userForm.jsp where the user corresponding to the record I have clicked
is displayed. I can now edit the record. When I save the record, I will first check if ever sombody else
has edited the record i am editing while I was editing it. In short, I implement timestamping of records.
Now, if somebody else has edited it, I will then be asked to refreshed the page in order to load the new record.
Is this not possible? When I reload the page, the data isn't really reloaded. It's just prompt me this message:


To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.



Is what I am asking not possible? Like it is part of struts design? Or have I implemented it wrongly?

Here's a snippet of my action class that retrieves the data from the database:



Basically, from the previous page (where all records are listed in the grid) the name of the radio button is "username" and it carries a unique username value
which will used to query to the database as shown above.

Please advise.

-marckun
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Marc Heruela wrote: When I reload the page, the data isn't really reloaded. It's just prompt me this message:


To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.


Is what I am asking not possible? Like it is part of struts design? Or have I implemented it wrongly?


Google the same error message and you get plenty of links discussing this issue(Its not an issue, its how FF warns you about the repetition of previous action which leads to unnseeasry duplication of data entry at server side, mainly beacuse of several users has a habit of double clicking the same action button, like submit )

 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i dont know why you confuse with refresh the page?. as per your requirement , just updte the data and forward it to the page.

 
Marc Heruela
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sagar Rohankar wrote:

Marc Heruela wrote: When I reload the page, the data isn't really reloaded. It's just prompt me this message:


To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.


Is what I am asking not possible? Like it is part of struts design? Or have I implemented it wrongly?


Google the same error message and you get plenty of links discussing this issue(Its not an issue, its how FF warns you about the repetition of previous action which leads to unnseeasry duplication of data entry at server side, mainly beacuse of several users has a habit of double clicking the same action button, like submit )



seetharaman venkatasamy wrote:i dont know why you confuse with refresh the page?. as per your requirement , just updte the data and forward it to the page.



hmmm.. i wasn't really complaining about the messages prompted (and i think it is not an error). What I wanna ask is that, after I refresh the page,

The data in the form is not really updated, it does not load the new data from the database. Like after I forcefully edit the data in the database,

when I refreshed the page, it doesnt do anything. Like the same data are still there:

for instance:

displayed data on first load: xxxx

i edit it to: xxxxyyyy (but i did not save this change to the database)

then i change value in the database via command line: xxxx ->>>> aaaaa

when i reload page value is still: xxxxyyyy

it does not really reload the data.

-marckun

 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Marc Heruela wrote:
for instance:

displayed data on first load: xxxx

i edit it to: xxxxyyyy (but i did not save this change to the database)

then i change value in the database via command line: xxxx ->>>> aaaaa

when i reload page value is still: xxxxyyyy

it does not really reload the data.


Considering above example, please check and debug the underlying JDBC code which fetch the data, put some print statement to check which data is actually going to transfer to JSP before and after manual data insertion.
 
Marc Heruela
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sagar Rohankar wrote:

Marc Heruela wrote:
for instance:

displayed data on first load: xxxx

i edit it to: xxxxyyyy (but i did not save this change to the database)

then i change value in the database via command line: xxxx ->>>> aaaaa

when i reload page value is still: xxxxyyyy

it does not really reload the data.


Considering above example, please check and debug the underlying JDBC code which fetch the data, put some print statement to check which data is actually going to transfer to JSP before and after manual data insertion.



Sorry it took me pretty long to reply.. i was away for awhile.

Anyways, while trying to figure this thing out, iv noticed some weird stuff..

scenario: i have a form that will get data from the database, with a submit button.

Case 1: (IE8)
- on first load of the form, i did this:
a: delete or manually remove the data from the textfields.
b: click "Refresh" button.
c: DATA IS RESTORED

- on first load of the form, i also did this:
a: delete or manually remove the data from the textfields.
b: Went to the "Address Bar" and hit it (in short, i sent the same request to the database)
c: DATA IS RESTORED

- on first load of the form, i did this:
a: modify the data such that when submitted, it wont pass the validation (STRUTS2 VALIDATION)
b: click "Submit", sure enough, the form is not submitted, the error message is displayed
c: the updated/modified invalid (unpersisted) data are still in the form (as expected)
e: click on "Refresh", ie prompted me a message that the form will be resubmitted.
f: i click OK, and the DATA IS NOT RESTORED. Meaning the same invalid modified/updated (unpersisted) data is still in the form.
g: when i went to the "Address bar" and hit it, the form is cleared (to my horror).

Case 2: (FIREFOX 3.5)
- on first load of the form, i did this:
a: delete or manually remove the data from the textfields.
b: click "Refresh" button.
c: DATA IS NOT RESTORED, TEXTFIELD REMAINS BLANK.

- on first load of the form, i also did this:
a: delete or manually remove the data from the textfields.
b: Went to the "Address Bar" and hit it (in short, i sent the same request to the database)
c: DATA IS RESTORED.

- on first load of the form, i did this:
a: modify the data such that when submitted, it wont pass the validation (STRUTS2 VALIDATION)
b: click "Submit", sure enough, the form is not submitted, the error message is displayed
c: the updated/modified invalid (unpersisted) data are still in the form (as expected)
e: click on "Refresh", firefox prompted me a message that the form will be resubmitted.
f: i click OK, and the DATA IS NOT RESTORED. Meaning the same invalid modified/updated (unpersisted) data is still in the form.
g: when i went to the "Address bar" and hit it, the form is cleared (to my horror).

can you please enlighten me?

thanks,
-marckun
 
reply
    Bookmark Topic Watch Topic
  • New Topic