-
1. Re: KeepAlive Behaviour
nbelaevski Sep 3, 2009 9:06 PM (in response to dgashby)Hi Dean,
Thanks for investigating and describing this - message has good level of details and is easy to read!
I've created JIRA issue: https://jira.jboss.org/jira/browse/RF-7807 -
2. Re: KeepAlive Behaviour
xck3001 May 4, 2010 8:56 AM (in response to nbelaevski)Hi,
we tried to use some beans like this in JSF2 with RF 3.3.3.FINAL:
@ManagedBean @RequestScoped @KeepAlive public class DataBean { ... } @ManagedBean @RequestScoped public class DataController { @ManagedProperty( value="#{dataBean}" ) private DataBean dataBean; ... }
On a test page using some ajax interaction, this worked fine. The injected dataBean instance is always the same as long as the user doesn't leave the view.
But in our application the same approach doesn't work. The injected dataBean instance differs each time DataController is called. JSF seems not to notice that there is already a bean of this type present and creates a new one each time. As our application is rather complex, it is hard to determine where the difference to my test page is.
Can you name some requirements for the @KeepAlive - injection to work properly?
Thanks in advance,
Matthias
-
3. Re: KeepAlive Behaviour
ilya_shaikovsky May 4, 2010 9:40 AM (in response to xck3001)not investigated the reasons of the failure, just have quick proposal.. how about to use not request scope with keepAlive but just viewScope if you using JSF 2?
-
4. Re: KeepAlive Behaviour
xck3001 May 4, 2010 9:45 AM (in response to ilya_shaikovsky)We had some issues with @ViewScoped and another library (PrettyFaces). But thanks to your advice I check again and they released a new version which seems to fix this problem.
I will check if this error stays with @ViewScoped and report back soon.
Thank you so far!
-
5. Re: KeepAlive Behaviour
xck3001 May 4, 2010 9:56 AM (in response to xck3001)Works just like expected. The only thing I did was replacing @KeepAlive with @ViewScoped, so it must have been some special behaviour of keepAlive. Thank you!