JSF 版本由什么决定?容器还是面孔配置?
我目前正在 JBoss AS 4.3 上运行旧版 JSF 应用程序。我相信这实现了 JSF 1.2。然而,当我查看 faces-config 时,我发现它使用的是 JSF 1.1 DTD。
我使用的是哪个版本的 JSF?
I am currently running a legacy JSF application on JBoss AS 4.3. I believe that this implements JSF 1.2. However, when I looked at the faces-config, I saw that it was using the JSF 1.1 DTD.
Which version of JSF am I using?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确切的 JSF 实现版本信息可在 JSF 实现 JAR 文件的
/META-INF/MANIFEST.MF
文件中找到。它通常位于清单文件底部附近,如下所示:JAR 文件可以使用 ZIP 工具打开。对于 Sun RI / Mojarra,文件名是/deploy/jboss-web.deployer/jsf-libs 中找到该文件文件夹。如果您在
jsf-impl.jar
,有时已经带有确切的版本号后缀,例如jsf-impl-1.2_12-b01-FCS.jar
代码>.如果您使用的是 JBoss 4.3.x 提供的 JSF 实现,那么您可以在 $JBOSS_HOME/server//WEB-INF/lib
中提供了自己的 JSF 实现,并配置了web.xml
来告诉 JBoss 使用它,那么您需要在其中检查它相反,在/WEB-INF/lib
中提供。或者,您可以通过编程方式获取它:
对于
faces-config.xml
,您还可以使用它来控制应用程序设计的 JSF 版本。因此,如果您声明它符合 JSF 1.1 规范,那么即使是 JSF 1.2/2.0 实现也会以 JSF 1.1“兼容性模式”运行。但是,当您实际上使用 JSF 1.1 实现时,您不能声明它符合 JSF 1.2/2.0 等较新版本。它要么出错,要么被忽略。The exact JSF implementation version information is available in
/META-INF/MANIFEST.MF
file of the JSF implementation JAR file. It's usually located near the bottom of the manifest file as follows:A JAR file can be opened with a ZIP tool. In case of Sun RI / Mojarra, the filename is
jsf-impl.jar
, sometimes already suffixed with exact version number such asjsf-impl-1.2_12-b01-FCS.jar
. If you're using the JSF implementation supplied by JBoss 4.3.x, then you can find the file in$JBOSS_HOME/server/<Profile>/deploy/jboss-web.deployer/jsf-libs
folder. If you supplied your own JSF implementation in/WEB-INF/lib
and configuredweb.xml
to tell JBoss to use it instead, then you need to check it in the one supplied in/WEB-INF/lib
instead.Or, you can just get it programmatically:
As to the
faces-config.xml
, with it you can also control what JSF version the application is designed for. So if you declared it conform JSF 1.1 spec, then even a JSF 1.2/2.0 implementation will run in JSF 1.1 "compatibility modus". But you cannot declare it conform a newer version like JSF 1.2/2.0 when you're actually using a JSF 1.1 implementation. It will either error out or be ignored.