mojarra
mojarra copied to clipboard
Modified the ViewHandlingStrategies for JSP and Facelet to allow recursive calls
WriteBehindStateWriter is kept in a ThreadLocal, presumably to allow interoperability between the JSP and Facelet ViewHandlingStrategy implementations. However, this has the unfortunate side effect of preventing recursive calls to view rendering without creating a new thread.
Adding a setCurrentInstance method to WriteBehindStateWriter and a try-finally to the JSP and Facelet ViewHandlingStrategy's renderView methods allows us to account for potential preexisting WriteBehindStateWriters in the current Thread.