wood burning stoves 2.0*
The moose likes Servlets and the fly likes know all the context names within the web container Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "know all the context names within the web container" Watch "know all the context names within the web container" New topic
Author

know all the context names within the web container

lakshmana dhanimireddi
Greenhorn

Joined: Jul 05, 2011
Posts: 18

How can we know all the context names or all the web app names with in the web container in a servlet?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
You could use the JMX API, like the Management web app or PSI-Probe do for Tomcat. I'm sure other servlet container offer similar functionality.
lakshmana dhanimireddi
Greenhorn

Joined: Jul 05, 2011
Posts: 18

But i don't want to use the apis otherthan servlet api.

Is there any way to solve this problem using servlet api.

thank you for your reply.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
But i don't want to use the apis otherthan servlet api.

Why not?

JMX is the API to find out stuff like that. It's also part of the JSE, if -for some reason- that's your concern.
lakshmana dhanimireddi
Greenhorn

Joined: Jul 05, 2011
Posts: 18

Can you tell me how?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
I'd check out the PSI-Probe source code; obviously it has code that does this somewhere in it.
lakshmana dhanimireddi
Greenhorn

Joined: Jul 05, 2011
Posts: 18

I also tried but i can't find out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: know all the context names within the web container
 
Similar Threads
User log-in process
Definitions and usage of getContext()
Identify context path + servlet path+ path info for given URL
Duplication of Servlet Context on each JVM
Spring IOC Container