当前位置: 首页 > 工具软件 > Ajax4JSF > 使用案例 >

ajax4jsf afterphase,jsf 2 - Migrating JSF 1.1 with Ajax4jsf 1.x to JSF 2 - Stack Overflow

顾永福
2023-12-01

We are migrating JSF 1.1 (MyFaces) project to JSF 2. The idea is to migrate periodically by keeping both JSP and XHTML together for some time. We use many ajax4jsf-1.1.1 tags in JSP pages. We don't use RichFaces. After configuring the system to JSF 2 (with all config changes mentioned in tutorial by Balusc) When tried to access the JSP page with ajax4jsf.jar in classpath, we get an exception:

Caused by: java.lang.IllegalStateException: setViewHandler may not be executed after a lifecycle request has been completed

at org.apache.myfaces.application.ApplicationImpl.setViewHandler(ApplicationImpl.java:853)

at org.ajax4jsf.framework.ajax.InitPhaseListener.beforePhase(InitPhaseListener.java:92)

at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:76)

at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:131)

It looks ajax4jsf.jar is not compatible with JSF 2. Looks some issue with LifeCycle configuration.

Is there any way we can make a4j work with JSF 2 JSPs? I know when we use XHTML we don't need all this.

 类似资料: