0

I've got two pages on my JSF application.

  • page1 is requestscoped and has a form on its site
  • page2 is viewscoped and shows the values from page1 which are entered

From page1 to page2 i'm using flashscope to transfer the input data. That works fine, but if i want to go back to page1 via button-click, i will get ViewExpiredException. HistoryBack on Browser does work. I would see the input-values on page1 again, if i would go back from page2.

In my navigation rule i'm not using redirect.

What i'm doing wrong?

Should i use in page1 viewscope too?

I'm using myfaces 2.1.6

Tobi
  • 1,440
  • 1
  • 13
  • 26
  • *"but if i want to go back to page1 via button-click"* Please show the involved code. Note that when you want to see the values on page1 again, you'd need to pass them from page2 to page1. Browser back button just loads the page from the browser cache and some browsers will also autocomplete the fields. – BalusC Mar 21 '12 at 13:51
  • Okay, now i reached the problem. I just put the Values in a Flash. Also from page1 -> page2 and page2 -> page1. But there is a new problem: if i refresh page2 two times, the flash is null! i think, that could be, because the browser-url changes one time. how can i solve this problem? – Tobi Mar 21 '12 at 14:36
  • I think you misunderstood the flash scope. The flash scope expires after you hits the target page. You need to pass those values as request parameters from page1 to page2 and set them in the view scoped bean. – BalusC Mar 21 '12 at 14:41
  • The flash scope expires, after i read the flash scope via get, isn't it? can you give me an example please, how to pass values as request parameters? thanks! – Tobi Mar 21 '12 at 14:47

0 Answers0