Hi Everybody
I've recently started working on a project, using
JSF. I'll admit that my knowledge of JSF is very limited, and I've run into a problem.
On one of my pages, I've got a button that updates a session variable from an action method in a request scoped backing bean when it's clicked. The constructor of the backing bean makes use of this variable to set up some of the stuff displayed on the page. The problem is that the constructor of the page appears to be called before the action method, thereby leaving my page in an incorrect state. The following
SSCCE should demonstrate the problem.
faces-config.xml
TestBean.java
test.jsp
When clicking the button on the above page, the following is printed to the console:
In constructor
In actionListenerMethod()
In actionMethod()
Could anyone please gice me some pointers on solving my problem? Your opinions will be much appreciated. Thanks a lot!
Regards,
Riaan