JSF: Managed-Bean with Request Scope
I'm getting starting with JSF and I need your help for a doubt. :o
Reading the documentation, I understand that a managed bean with scope request is created when a page is called from the browser, and it is killed when the response is returned to brower.
Now, I've done this test:
- Page A, with a button "next" and an input text field. There is also a navigation rule from Page A to Page B on click.
- Page B, with a button "back" and an output text field. There is also a navigation rule from page A to page B on click.
- I created a Bean with request scope and an attribute of type String. This attribute is linked on text fields in pages.
then, this happens:
- Start Page A, I type a text on input field and click on button.
- When page B is rendered, the input field in page B shows the same text that I digited on page A.
- When click on button in page B, page A is loaded and the text is the same.
If the scope is request, I hope that the Constructor of Bean runs everytime!!
Anyone can explain me why??
Thanks at all in advance...