read manifest file during tomcat runtime

Hi all

I have made a web application running on Tomcat.
The application is as war file, which contains multiple jar files in /lib folder.

I would like to show how many jar files are using in the war, and which version they are using.

How to achieve it (without hardcode the physical location of the files) ?
I tried to check the java.class.path but it does not work.

Rgds/Glogin
gloginAsked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
File lib = application.getRealPath("/WEB-INF/lib");
File[] jars = lib.listFiles();
0
 
gloginAuthor Commented:
Thanks.
How can I get the application from java bean / java program, instead of JSP?
0
 
objectsCommented:
a java application will not have a ServletContext, only in web applications .
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.