2

We are migrating our JSF 1.2 project to JSF 2.0 and using a command button in a JSP page .Clicking command button get a reponse from external system and display response.

While clicking this command button we are getting blank page with below execption

During debug I found that we are getting a success response but its not able to find original page as it lost state view ID

[8/13/13 11:01:30:538 CDT] 000000e0 webapp        E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[Faces Servlet]: java.lang.NullPointerException: viewId parameter for  save view state is null
    at org.ajax4jsf.application.AjaxStateHolder.saveState(AjaxStateHolder.java:155)
    at org.ajax4jsf.application.AjaxStateManager.saveStateInSession(AjaxStateManager.java:523)
    at org.ajax4jsf.application.AjaxStateManager.buildViewState(AjaxStateManager.java:503)
    at org.ajax4jsf.application.AjaxStateManager.saveView(AjaxStateManager.java:462)
    at org.apache.myfaces.shared_impl.view.JspViewDeclarationLanguageBase.renderView(JspViewDeclarationLanguageBase.java:206)
    at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:263)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
    at org.apache.myfaces.tomahawk.application.ResourceViewHandlerWrapper.renderView(ResourceViewHandlerWrapper.java:169)
    at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
    at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)

Is there any specific config required in web.xml to save view state ?

4

1 回答 1

4

堆栈跟踪中 Ajax4jsf 1.x 特定org.ajax4jsf.*类的存在表明您仍在将 Ajax4jsf 用于 JSF 1.x。

这与 JSF 2.x不兼容。您必须删除所有与 Ajax4jsf 1.x 相关的 JAR 文件和web.xml. 您需要改用 JSF 自己的<f:ajax>工具,或者升级到 RichFaces 4.x,它捆绑了更新的、与 JSF 2.0 兼容的<a4j:xxx>标签版本。请注意,这反过来又需要 Facelets 而不是 JSP。因此,您还必须从 JSP 迁移到 Facelets。

也可以看看:

于 2013-08-13T16:34:45.503 回答