Whose sandbox is this? MyFaces?
Yep myfaces sandbox...
Well, I'm inclined to think this is bad design on the part of MyFaces, but if you add a JIRA issue, I suppose we can try to be more robust, or if that's not possible, at least throw a more meaningful exception.
Does my fix will cause side effects??
Can I leave my seam version like that (it works well!)?
I have tried... Your solutions will need more changes.
private Map getCurrentWritableMap()
PhaseId phaseId = Lifecycle.getPhaseId();
if (null==phaseId) return previousPageMap;
return Lifecycle.getPhaseId().compareTo(PhaseId.INVOKE_APPLICATION) < 0 ?
previousPageMap : nextPageMap;