• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

How to clear history of submitted page

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Check your pockets for water buffalo. You might need to use this tiny ad until locate a water buffalo:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic