我有一个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
>
第二次按下代码时运行正常 请就这个问题以及如何解决这个问题提出建议
答案 0 :(得分:0)
可能是因为您正在使用ice:form
并通过h:commandButton
提交。将commandButton更改为ice:commandButton
,然后重试。
变化:
<h:commandButton type="submit" value="#{msg.Login}"
action="#{loginBean.login}" />
为:
<ice:commandButton type="submit" value="#{msg.Login}"
action="#{loginBean.login}" />