Skip to content
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 MultiViewHandler#getRedirectURL #5220

Closed
svenhaag opened this issue Mar 23, 2023 · 1 comment
Closed

NPE MultiViewHandler#getRedirectURL #5220

svenhaag opened this issue Mar 23, 2023 · 1 comment
Labels
Milestone

Comments

@svenhaag
Copy link

svenhaag commented Mar 23, 2023

A NPE is thrown with Mojarra 2.3.19.
Mojarra 2.3.18 works fine.

The culprit lies in the usage of a NULL-valued redirect parameter.

java.lang.NullPointerException: null
	at java.net.URLDecoder.decode(URLDecoder.java:176)
	at java.net.URLDecoder.decode(URLDecoder.java:142)
	at com.sun.faces.application.view.MultiViewHandler.getRedirectURL(MultiViewHandler.java:419) ~[jakarta.faces-2.3.19.jar:2.3.19]
	at javax.faces.application.ViewHandlerWrapper.getRedirectURL(ViewHandlerWrapper.java:287) ~[jakarta.faces-2.3.19.jar:2.3.19]
	at javax.faces.application.ViewHandlerWrapper.getRedirectURL(ViewHandlerWrapper.java:287) ~[jakarta.faces-2.3.19.jar:2.3.19]
	at org.jboss.weld.module.jsf.ConversationAwareViewHandler.getRedirectURL(ConversationAwareViewHandler.java:145) ~[weld-servlet-shaded-3.1.9.Final.jar:3.1.9.Final]
	at javax.faces.application.ViewHandlerWrapper.getRedirectURL(ViewHandlerWrapper.java:287) ~[jakarta.faces-2.3.19.jar:2.3.19]
	at com.sun.faces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:291) ~[jakarta.faces-2.3.19.jar:2.3.19]
	at com.sun.faces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:206) ~[jakarta.faces-2.3.19.jar:2.3.19]
	at org.apache.deltaspike.jsf.impl.config.view.navigation.ViewConfigAwareNavigationHandler.handleNavigation(ViewConfigAwareNavigationHandler.java:146) ~[deltaspike-jsf-module-impl-1.9.6.jar:1.9.6]
	at org.apache.deltaspike.jsf.impl.scope.viewaccess.ViewAccessScopedAwareNavigationHandler.handleNavigation(ViewAccessScopedAwareNavigationHandler.java:51) ~[deltaspike-jsf-module-impl-1.9.6.jar:1.9.6]
	at org.apache.deltaspike.jsf.impl.navigation.DeltaSpikeNavigationHandler.handleNavigation(DeltaSpikeNavigationHandler.java:77) ~[deltaspike-jsf-module-impl-1.9.6.jar:1.9.6]
	at org.apache.deltaspike.jsf.impl.navigation.DeltaSpikeNavigationHandlerWrapper.handleNavigation(DeltaSpikeNavigationHandlerWrapper.java:47) ~[deltaspike-jsf-module-impl-1.9.6.jar:19.6[]
	at com.sun.faces.application.ActionListenerImpl.invokeNavigationHandling(ActionListenerImpl.java:110) ~[jakarta.faces-2.3.19.jar:2.3.19]
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:69) ~[jakarta.faces-2.3.19.jar:2.3.9[]
	at org.apache.deltaspike.jsf.impl.config.view.ViewControllerActionListener.processAction(ViewControllerActionListener.java:63) ~[deltaspike-jsf-module-impl-1.9.6.jar:1.9.6]

Using navigation rule:

    <navigation-rule>
        <from-view-id>*</from-view-id>
        <navigation-case>
            <from-outcome>b00m</from-outcome>
            <to-view-id>/faces/pages/b00m.xhtml</to-view-id>
            <redirect>
                <redirect-param>
                    <name>selectedAppId</name>
                    <value>#{b00mBean.selectedAppId}</value>
                </redirect-param>
            </redirect>
        </navigation-case>
    </navigation-rule>

example.zip

@BalusC
Copy link
Contributor

BalusC commented May 13, 2023

Has same root cause as #5226

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants