File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Standard API to get global information about any Servlet container? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Standard API to get global information about any Servlet container?" Watch "Standard API to get global information about any Servlet container?" New topic
Author

Standard API to get global information about any Servlet container?

Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1282

Hi friends,

can anybody tell me if there's a standardized way to get access to container wide information inside a typical Servlet container? That is I'd like to create a "manager" web application just like the Tomcat manager application which could be used to gather information about all applications running inside a Servlet container.

I know that the Tomcat manager application runs as a privileged context inside Tomcat and therefore has privileged access to detailed global information. But to my knowledge this is a Tomcat specific facility to manage the whole Servlet container and I wonder if there is a container-independent way to create such a "super application"?!? Or maybe there is a much better way to create a centralized manager application without modifying other applications. Then please let me know, I appreciate any advices!

Marco
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61419
    
  67

No, sorry.

You should familiarize yourself with the contents of the Servlet Specification (it's an easier read than you might expect). That will tell you everything that's available.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Every container manages things in a different way. Some might use JMX, some are based on OSGi, and so on. I think what you're trying to do is essentially impossible in any generic way without writing a lot of container-specific code. Heck, *external* deployment stuff is all quite different (witness all the Ant/Maven container plugins), let alone *internal*.

I could be way off base, though.
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1282

Thanks for clarification, Bear! I already suspected that there's at least no easy way inside the Servlet API itsel or something like said.

I already skimmed the Servlet spec some time ago but I think I'm going to make myself familiar with the new version 3.0.

Marco
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1282

Thanks David. I know that the typical specs don't make too much assumptions about implementation details of containers. I just wanted to be sure that I haven't overlooked any features, in particular because there were some efforts to unify container specific deployment issues with the new JEE version 6.

But that's no big deal. I just thought it would be nice to create some kind of container-independent manger application.

Marco
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Standard API to get global information about any Servlet container?