Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems on Refresh

 
Adrian Muscalu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My JSP page reads some data from a bean. The problem is that when a refresh appears, my page does not read anymore from the bean; instrad, it shows the values from the first initialization.
Where could be the problem?
Yours greenhorn,
Ady
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you are getting a new Bean with every request-response transaction.
If you want to save the state of the Bean between calls, you will have to attach it to the session with setAttribute() or make other provision for preserving it.
Bill
 
Adrian Muscalu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your reply Bill; in the meantime I've found a solution that is more suitable to my case:
<meta http-equiv="Expires" content="0"> produces exactly the effect that I wanted.
Regards,
Ady
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic