Reply To: Problem with conversation scope using Prettyfaces and Apache Myfaces CODI
Splash › Forums › PrettyFaces Users › Problem with conversation scope using Prettyfaces and Apache Myfaces CODI › Reply To: Problem with conversation scope using Prettyfaces and Apache Myfaces CODI
Meanwhile I’ve been investigating this problem a little more… What I’ve found so far:
1. If there is no path bind expression, then the ViewAccessScoped beans are maintained correctly
2. If there is a path bind expression to a different bean than the ViewAccessScoped one we are interested in (or looking at), then there is no issue and the ViewAccessScoped beans are actually maintained correctly.
3. This seems to happen both with Rewrite (with PrettyFaces integration modules) as well as PrettyFaces
4. The ViewAccessScoped bean get’s cleaned up on “injectParams” from rewrite (just before the injection occurs, the old instance is cleared and a new instance is created to serve the request).
5. The problem is related to the method “isExpired” in class ViewAccessConversationExpirationEvaluator from CODI.
In this code from the referred method at point 5 above :
String oldViewId = getOldViewId(); //oldViewId=page1.xhtml
if (oldViewId != null && oldViewId.equals(this.lastViewId))
this.lastViewId = getNewViewId(); //strangely, lastViewId becomes=page1.xhtml (which allready was)
String currentViewId = getCurrentViewId(); // page2.xhtml
if(currentViewId == null) //in case of an invalid view
boolean result = !currentViewId.equals(this.lastViewId); //so these are not equal and "result" becomes true, saying the context is "expired"
What I suspect is that the getNewViewId() method is somehow corrupt because Codi expects to have it’s own NavigationHandler doing something that Pretty rewrite is not doing the same way.
May you help further?