Indeed, in FacesConfigurator , the file is at a known place (much like a resource, or the .properties file I'm using now).
My problem is getting the MANIFEST.MF URL.
Plus, as you may use more than 1 MyFaces jar files (implementation, extensions, ...), I wonder if this approach would even work.
Thanks anyway.
Sylvain.
On Mon, 2005-03-14 at 18:05 +0100, Manfred Geiler wrote:
Sylvain Vieujot schrieb:
> By the way, does someone know how to get the Implementation Version from
> the jar file ?
> I used implementationHash =
> AddResource.class.getPackage().getImplementationVersion().hashCode();
> but the getImplementationVersion return null.
You mean the ImplementationVersion from the Manifest?
Try to get the META-INF/MANIFEST.MF file through an InputStream. Have a
look at the FacesConfigurator. It does something similar for
"META-INF/faces-config.xml".
Once you have the InputStream try the following:
Manifest manifest = new Manifest(is);
Attributes attributes = manifest.getAttributes("myfaces.apache.org");
version = attributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
HTH,
Manfred
<<attachment: smiley-6.png>>
