первый щелчок во льду: исключение CommandButton

у меня есть страница 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
> 

при повторном нажатии код работает нормально, пожалуйста, посоветуйте об этой проблеме и о том, как ее решить


person abdelhady    schedule 30.12.2013    source источник
comment
У меня работает тот же xhtml. У вас может быть что-то не так в файле web.xml или на странице шаблона, если вы обернули содержимое в шаблон ui:composition.   -  person Narayana Nagireddi    schedule 02.01.2014


Ответы (1)


Вероятно, это потому, что вы используете ice:form и отправляете его через h:commandButton. Измените свой commandButton на ice:commandButton, затем повторите попытку.

Изменять:

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

to:

<ice:commandButton type="submit" value="#{msg.Login}" 
    action="#{loginBean.login}" />
person Parkash Kumar    schedule 30.12.2013