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).
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.
For me it wasn’t working with a WebSphere Server, so I followed the comment of peater:
System.out.println("JSF API Location: " + FacesContext.class.getProtectionDomain().getCodeSource()); System.out.println("JSF Impl Location: " + Facelet.class.getProtectionDomain().getCodeSource());
It showed me the version in the filename of the library:
JSF API Location: (file:/C:/workspaces/spielwiese/wlp/dev/api/spec/com.ibm.websphere.javaee.jsf.2.2_1.0.18.jar )
JSF Impl Location: (file:/C:/workspaces/spielwiese/wlp/dev/api/spec/com.ibm.websphere.javaee.jsf.2.2_1.0.18.jar )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With