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

viewScoped bean recreated on page reload

 
eve agostini
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I have a little issue with viewScoped.

I have a very simple managed bean:


And an xhtml page:



If i click on the commandLink tha page is reloaded, the variable updated and everything works fine. But if I force page reload clicking on the browser button, the bean is instantiated again; so the constructor is called and the variable reinitialized. Is this the expected behavior or am I missing something?

Thanks

Eve

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic