• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How could I check the version of JSF

 
Ranch Hand
Posts: 32
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have joined a new project which makes use of jsf. There are 8+ applications, so I am wondering on how to check the version of JSF used in them?
 
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note that since JSF is integrated into JEE servers, unless the WAR overrides it, the JSF version in use is determined by the server, not the web application.

Unfortunately, I don't really know a good way to check the JSF version required to properly run a webapp. In theory, the schema version of the faces-config.xml file would do it, but it's not a reliable indicator.
 
Santosh Ganapa
Ranch Hand
Posts: 32
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following lines of code helped me!

FacesContext.class.getPackage().getImplementationVersion()
FacesContext.class.getPackage().getImplementationVendor()
FacesContext.class.getPackage().getImplementationTitle()
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remember that the APIs you are using will fetch that info from the jar file's MANIFEST.MF which may or may not have all that relevant information. It all depends on how the jar was built.
 
Bartender
Posts: 543
4
Netbeans IDE Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your project follows good practice, it will be specified in the project POM or parent POM.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dieter Quickfend wrote:If your project follows good practice, it will be specified in the project POM or parent POM.


In the case of JSF, those libraries are marked as provided (almost always) and are provided by the container. So even though at build time you might know the version you are compiling against, the exact version on the server might not always be the same.
 
Dieter Quickfend
Bartender
Posts: 543
4
Netbeans IDE Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jaikiran Pai wrote:In the case of JSF, those libraries are marked as provided (almost always) and are provided by the container. So even though at build time you might know the version you are compiling against, the exact version on the server might not always be the same.


You're right, of course. I hadn't thought about that.
 
Tim Holloway
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cogent points. You can tell what version the webapps require as a minimum by what version of the JSF-API jar they build from, but the actual server could have something more recent. However, it probably doesn't matter, since the API wouldn't have access to newer features.

All of which is worth considering, but the actual question was posed 2 months ago. I'm not sure if it's of more than academic interest by now as far as the original need went.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic