• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to clear history of submitted page

 
sa sam
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have created form in which i accept values from users, if users enter valid values it get submitted.

my problem is when i submit the page the values get submitted successfully in the database and i get diverted to other page but when i visit same page (form) without closing the browser i get same values in textbox which i have submitted last time.

so, please help me to solve this problem
 
eve agostini
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to reset the variables whose values are used to populate the form after you have passed the values to your business code
 
Ilari Moilanen
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the backing bean is in request scope you do not have this problem since the values do not persist after the request has ended.
So your problem exists because your backing bean is in session or application scope (or some other "long living" scope). And when you put values to a bean that is in a long living scope you have to delete those values yourself if you no longer need them! That is the price you have to pay for using a long living scope. But you have chosen to use a long living scope so I trust that you have a reason for it?

And this is not a JSF specific thing. If you for example put values to session scope in a normal Servlet environment then you have to delete those values yourself later on (or wait until the session expires).
 
sa sam
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
he thanks Ilari Moilanen,
what a silly mistake i was doing.
i spend 2 days to find this solution.
once again thank you very much.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!