This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Problems on Refresh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark "Problems on Refresh" Watch "Problems on Refresh" New topic

Problems on Refresh

Adrian Muscalu
Ranch Hand

Joined: May 08, 2000
Posts: 73
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,

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13001
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.
Adrian Muscalu
Ranch Hand

Joined: May 08, 2000
Posts: 73
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.
Have you checked out Aspose?
subject: Problems on Refresh
It's not a secret anymore!