0

我有一个 IceFaces 1.8 和 jsf 1.1 jsp 页面

<ice:form partialSubmit="true">
                                        <ice:messages />
                                        <ice:panelGrid columns="2">
                                            <ice:outputText value="#{msg.UserName}"></ice:outputText>
                                            <h:inputText required="true" id="UserName"
                                                value="#{loginBean.userName}" />

                                            <ice:outputText value="#{msg.Password}"></ice:outputText>
                                            <h:inputSecret id="Password" required="true"
                                                value="#{loginBean.password}" />

                                            <ice:outputText value=""></ice:outputText>
                                            <h:commandButton type="submit" value="#{msg.Login}"
                                                action="#{loginBean.login}" />
                            </ice:panelGrid>
                                </ice:form>

当第一次点击登录按钮时,动作抛出异常

java.lang.RuntimeException: no message available
    at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:177)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)
    Truncated. see log file for complete stacktrace
java.lang.NullPointerException
    at com.sun.faces.application.NavigationHandlerImpl.getViewId(NavigationHandlerImpl.java:160)
    at com.sun.faces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:106)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:89)
    at javax.faces.component.UICommand.broadcast(UICommand.java:312)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
    Truncated. see log file for complete stacktrace
> 

当第二次按下时,代码运行良好,请就这个问题提出建议以及如何解决它

4

1 回答 1

0

可能是因为您正在使用ice:form并通过h:commandButton. 更改您的命令按钮,ice:commandButton然后重试。

改变:

<h:commandButton type="submit" value="#{msg.Login}" 
     action="#{loginBean.login}" />

至:

<ice:commandButton type="submit" value="#{msg.Login}" 
    action="#{loginBean.login}" />
于 2013-12-30T19:25:40.530 回答