如何检测当前的JSF版本? [英] How to detect current JSF-Version?

查看:177
本文介绍了如何检测当前的JSF版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发jsf-webapp,现在我需要知道我使用的是什么JSF版本?我在哪里可以找到这个?预先感谢.

I am developing a jsf-webapp and now I need to know what JSF-Version I am using? Where can I look this up? Thanks in advance.

推荐答案

以编程方式,是什么意思?您可以从 .

Programmatically, you mean? You can get it from Package#getImplementationVersion().

String version = FacesContext.class.getPackage().getImplementationVersion();

还有

There are by the way also getImplementationVendor() and getImplementationTitle() methods. You might want to use it as well in order to distinguish the vendor (MyFaces or Mojarra, for example).

还是手动?只需查看JSF impl JAR文件的/META-INF/MANIFEST.MF文件.您可以使用ZIP工具提取JAR文件.这是清单文件的Implementation-Version条目.

Or do you mean manually? Just look in /META-INF/MANIFEST.MF file of the JSF impl JAR file. You can extract the JAR file with a ZIP tool. It's the Implementation-Version entry of the manifest file.

这篇关于如何检测当前的JSF版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆