带有from-outcome不是字符串(boolean)的faces-config失败,并出现NullPointerException [英] faces-config with from-outcome not being string (boolean) fails with NullPointerException

查看:270
本文介绍了带有from-outcome不是字符串(boolean)的faces-config失败,并出现NullPointerException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在将JSF 2.1与mojarra-2.1.20一起使用,并且已经在我的faces-config.xml中配置了这样的导航用例:

I've been using JSF 2.1 with mojarra-2.1.20, and I've configured in my faces-config.xml a navigation case like this:

<navigation-rule>
    <from-view-id>/loggedOut.xhtml</from-view-id>
    <navigation-case>
        <from-action>#{sessionManager.isLoggedIn}</from-action>
        <from-outcome>true</from-outcome>
        <to-view-id>/login.xhtml</to-view-id>
        <redirect />
    </navigation-case>
</navigation-rule>

使用

The action is executed using seam-faces viewAction (similiar to JSF 2.2 new tag). All has been working fine.

今天,我已使用mojarra-2.2.6升级到JSF 2.2,并浏览到视图loggedOut.xhtml停止工作.它会抛出此堆栈跟踪:

Today I've upgraded to JSF 2.2 with mojarra-2.2.6, and browsing to the view loggedOut.xhtml stoped working. It throws this stacktrace:

java.lang.NullPointerException
    at com.sun.faces.application.NavigationHandlerImpl.determineViewFromActionOutcome(NavigationHandlerImpl.java:1342)
    at com.sun.faces.application.NavigationHandlerImpl.findExactMatch(NavigationHandlerImpl.java:603)
    at com.sun.faces.application.NavigationHandlerImpl.getViewId(NavigationHandlerImpl.java:481)
    at com.sun.faces.application.NavigationHandlerImpl.getNavigationCase(NavigationHandlerImpl.java:149)
    at com.sun.faces.application.NavigationHandlerImpl.getNavigationCase(NavigationHandlerImpl.java:140)
    at org.jboss.seam.faces.event.SeamPreNavigationHandler.getNavigationCase(SeamPreNavigationHandler.java:42)
    at org.jboss.seam.faces.event.SeamPreNavigationHandler.handleNavigation(SeamPreNavigationHandler.java:57)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:132)
    at org.jboss.seam.faces.component.UIViewAction.broadcast(UIViewAction.java:381)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
    at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:931)
    at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
    ...

我有更多这样的导航,所有导航都以相同的方式失败.此导航与其他情况和示例之间的唯一区别是from-outcome值是boolean而不是String.所以我的问题是:

I have more navigations like this, and all of them fail in the same way. The only difference between this navigations and other cases and examples is that from-outcome value is a boolean and not a String. So my questions are:

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆