• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

New page is loading with old values

 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application contains 4 forms, for the first time I created application by running four JSPs successfully, after that I tried to create another application, while creating I see a strange thing the when after I submitted forst page, it supposed to go second page with blank fields, but here the old values are showing in the fields.
what could be the issue here and how to clean the form fields when new page enters?
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the form bean for your transaction session scoped? You may need to add code to the reset method of your form to clear out the values between requests.
 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Tom, they are session,

even though I have already reset method which is making nulls to form fields
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you tell if your application server is being called when the page opens with the data on it, or if IE is pulling the page from its cache?
 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the previous page's data is stored in DB, then Im forwarding to current JSP. I think it could be the cache problem,

but if I use request scope in the action configuration, then the page is loading without data.
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the form bean that you have specified for the action the same form bean that is used by the JSP. You may need to call reset on the form used by the JSP before the JSP is executed.
 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but Im using reset method in the form bean, is there any other way to call this reset method before jsp loads?
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can call that reset method from the action class if you like. If you call reset on the form before just before your action class ends and the fields that you've reset still have values, then I would assume that the problem is that your browser is caching the page.
 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we call reset method explicitly in our corresponding action class?
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, I don't see anything that would stop you. Infact I think I've done this before.
 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tom,

I have tried by calling reset method after DB calling done, yes I got no previous data in the fields.

Thanks for this idea.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic