Yes and for WAR files there are two ways. First of all you can use the getRealPath() method on the ServletContext object althought this isn't recommended as it doesn't work too well!
The best way (that I've found) is to use the ServletContext.getResources() method. I use this in my TagUnit
testing framework to find a list of all test*.jsp files underneath a certain directory. Here's a snippet from TagUnit to help you on your way...
Hope that's useful! I've tested this code in WebLogic 7, Websphere 5,
Tomcat 4, Resin 2, Jetty (recent version) and it works a treat. However, it doesn't work with OC4J/Oracle 9i at the moment.
For JAR files, you have to use the classes in java.util.jar - I also do this in TagUnit so I'll try to dig out some code for you...
Cheers
Simon
[ March 21, 2003: Message edited by: Simon Brown ]