New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPE in ExternalContextImpl.encodeRedirectURL when no ViewRoot available #5383
Comments
Can you elaborate a bit more about the actual use case triggering this NPE? |
DeltaSpikeLifecycleWrapper tries to attach DS-WindowID and redirect
|
Okay. But apart from this I think the check for response encoding can be further improved. The existing impl makes little sense by basically storing and checking it in 5 different places (HttpServletRequest, FacesContext, UIViewRoot, HttpSession, HttpServletResponse). I want to take a closer look at it. |
I reviewed all the involved logic and did some cleanup #5385 |
…_facelets_encoding_management #5383 cleanup facelets encoding management
ExternalContextImpl.encodeRedirectURL tries to access ViewRoot.attributes w/o checking, if ViewRoot is set.
In cases, when no ViewRoot has been identified (e.g. Window-ID redirect), this causes a NullPointerException!
StackTrace:
ERROR [io.undertow.request] UT005023: Exception handling request to /pfad/NewFile.xhtml: java.lang.NullPointerException: Cannot invoke "jakarta.faces.component.UIViewRoot.getAttributes()" because the return value of "jakarta.faces.context.FacesContext.getViewRoot()" is null
at jakarta.faces.impl@4.0.4//com.sun.faces.context.ExternalContextImpl.encodeRedirectURL(ExternalContextImpl.java:996)
at jakarta.faces.impl@4.0.4//jakarta.faces.context.ExternalContextWrapper.encodeRedirectURL(ExternalContextWrapper.java:1064)
at jakarta.faces.impl@4.0.4//jakarta.faces.context.ExternalContextWrapper.encodeRedirectURL(ExternalContextWrapper.java:1064)
The text was updated successfully, but these errors were encountered: