From a servlet, I need to gather certain information about the container for logging purposes. For example, I need to know the name of the application server I am running in. Also, I'd like to be able to access server settings such as those within the WebSphere Variables environment.
First, I'd do it in a ServletFilter, that way you can attache the filter to any Servlet you want.
To grab that information, I think you're going to have to get familiar with MBeans, or Management Beans.
Take a look at the Resource Analyzer, or the Tivoli Resource Analyzer, or the IBM Rational Tivoli WebSphere Analyzer, or whatever they call it now. That grabs all of its information by interacting with MBeans. It's probably that type of information you're interested in mining from your application.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop