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

在将使用MyFaces的JSF1.1项目逐步迁移到JSF2时,遇到问题。尽管尝试了配置更改,但在JSP页面中使用ajax4jsf-1.1.1标签时,出现异常,表明该库可能不兼容JSF2。异常涉及到生命周期请求已完成后的视图处理器设置。虽然知道在使用XHTML时不需要这些,但目前目标是使ajax4jsf在JSF2的JSP页面中正常工作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值