You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by kgaekwad <ka...@ni.com> on 2010/05/06 17:30:50 UTC

Reading tomcat context.xml file from webapp

Hello,

Is there a way to read the context.xml stored in /conf/ folder from a
webapplication?

Thank you!

-K
-- 
View this message in context: http://old.nabble.com/Reading-tomcat-context.xml-file-from-webapp-tp28475444p28475444.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Reading tomcat context.xml file from webapp

Posted by kgaekwad <ka...@ni.com>.
Interesting. This is the first time I've played around with JMX, and it looks
pretty neat. I see the parameter I'm looking for; I'll just need to figure
out how to programmatically parse it.

Thank you! 


n828cl wrote:
> 
>> From: kgaekwad [mailto:karthik.gaekwad@ni.com]
>> Subject: Re: Reading tomcat context.xml file from webapp
>> 
>> one of these dependencies is the db, which is
>> configured in the context.xml file....
> 
> You can also use JMX to access numerous attributes maintained by Tomcat. 
> Enable JMX for your Tomcat and poke around with JConsole to see what's
> available.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Reading-tomcat-context.xml-file-from-webapp-tp28475444p28478025.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Reading tomcat context.xml file from webapp

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kgaekwad [mailto:karthik.gaekwad@ni.com]
> Subject: Re: Reading tomcat context.xml file from webapp
> 
> one of these dependencies is the db, which is
> configured in the context.xml file....

You can also use JMX to access numerous attributes maintained by Tomcat.  Enable JMX for your Tomcat and poke around with JConsole to see what's available.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Reading tomcat context.xml file from webapp

Posted by kgaekwad <ka...@ni.com>.
This is true.

I'm trying to create a /status page for my application and it's dependencies
(ip address/dns name); one of these dependencies is the db, which is
configured in the context.xml file....

I guess I could use the regular java file io stuff, but I was wondering if
there was anything else I could call.

But that works pretty well :-) Thanks!


Pid * wrote:
> 
> On 06/05/2010 16:30, kgaekwad wrote:
>> 
>> Hello,
>> 
>> Is there a way to read the context.xml stored in /conf/ folder from a
>> webapplication?
> 
>  String pathToContextXmlFile = "...";
>  File contextXmlFile = new File(pathToContextXmlFile);
> 
> Why would you want to do such a thing?
> 
> 
> p
> 
> 
> 
>  
> 

-- 
View this message in context: http://old.nabble.com/Reading-tomcat-context.xml-file-from-webapp-tp28475444p28476767.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Reading tomcat context.xml file from webapp

Posted by Pid <pi...@pidster.com>.
On 06/05/2010 16:30, kgaekwad wrote:
> 
> Hello,
> 
> Is there a way to read the context.xml stored in /conf/ folder from a
> webapplication?

 String pathToContextXmlFile = "...";
 File contextXmlFile = new File(pathToContextXmlFile);

Why would you want to do such a thing?


p



RE: Reading tomcat context.xml file from webapp

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kgaekwad [mailto:karthik.gaekwad@ni.com]
> Subject: Reading tomcat context.xml file from webapp
> 
> Is there a way to read the context.xml stored in /conf/ 
> folder from a webapplication?

You can issue normal Java I/O requests to the file system path, but ...

Why do you want to?  What's the real requirement here?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org