从Facelets 1.1迁移到Faclets 2.0-FaceletViewHandler [英] Migrating from facelets 1.1 to faclets 2.0 - FaceletViewHandler
问题描述
我已阅读以下帖子,该帖子非常有帮助 从JSF 1.2迁移到JSF 2.0
I have read the following post which was very helpful Migrating from JSF 1.2 to JSF 2.0
但是我遇到了迁移问题,因为我有一个从FaceletViewHandler扩展的自定义视图处理程序-这不是faclets 2的一部分.
but I am having a problem with the migration as I have a custom view handler which extends from FaceletViewHandler - this is not part of faclets 2.
我正在以下迁移JBoss 4.2.2: -从JSF 1.2到JSF 2.0
I am migrating on JBoss 4.2.2 the following: - JSF 1.2 to JSF 2.0
我也想迁移小孔-我遇到了上述问题.
I also want to migrate the faclets - which i have a problem described above.
在我的应用程序中,我也正在使用Tomahawk-此迁移是否有任何问题?
In my application, I am also using Tomahawk - is there any problem with this migration?
谢谢.
Elico.
推荐答案
正确的是,您需要将FaceletViewHandler
替换为
Right, you need to replace FaceletViewHandler
by ViewHandlerWrapper
.
因此,以下是基本的FaceletViewHandler
实现:
So the following basic FaceletViewHandler
implementation:
import javax.faces.application.ViewHandler;
import com.sun.facelets.FaceletViewHandler;
public class MyViewHandler extends FaceletViewHandler {
public MyViewHandler(ViewHandler parent) {
super(parent);
}
// ...
}
需要进行如下更新:
import javax.faces.application.ViewHandler;
import javax.faces.application.ViewHandlerWrapper;
public class MyViewHandler extends ViewHandlerWrapper {
private ViewHandler wrapped;
public MyViewHandler(ViewHandler wrapped) {
this.wrapped = wrapped;
}
@Override
public ViewHandler getWrapped() {
return wrapped;
}
// ...
}
我已经相应更新了有关迁移问题的答案.
I've updated my answer on the migration question accordingly.
这篇关于从Facelets 1.1迁移到Faclets 2.0-FaceletViewHandler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!