Using JNDI variables is considered a good option as it is part of J2EE specs
... 
And that it is supported by all j2ee app servers and web containers. 

I cant think of anything else  because your context can come from not only
base webapps but from any where else 
Example : manager / admin application in tomcat .... 

So better use JNDI variable to the fullpath of the configuration file and
then open it :o)

This is because if you deploy the app as a .war then you wont be able to do
getResourceAsStream(fileName) withing that context.

Need more help ?
Email me 


Regards
Guru 


-----Original Message-----
From: Michal Kwiatek [mailto:[EMAIL PROTECTED] 
Sent: 12 April 2005 10:35
To: Tomcat Users List
Subject: RE: Check deployment dir programatically


This is a solution. I'll do it if there's not a better one. Any other
ideas?

Michal. 

> -----Original Message-----
> From: Raghupathy,Gurumoorthy 
> [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, April 12, 2005 11:27 AM
> To: 'Tomcat Users List'
> Subject: RE: Check deployment dir programatically
> 
> Why  dont you setup a JNDI variable for your context which 
> will set the value of base directory ... And then use it in 
> your app... 
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources
> -howto.html
> 
> We use JNDI ... :o) 
> 
> 
> -----Original Message-----
> From: Michal Kwiatek [mailto:[EMAIL PROTECTED]
> Sent: 12 April 2005 10:16
> To: Tomcat Users List
> Subject: Check deployment dir programatically
> 
> 
> Hello all,
> 
> How can I programatically check the absolute path to the deployment
> direcotory (webapps/myApp directory) on the server?
> 
> request.getSession().getServletContext().getResourceAsStream(fileName)
> works fine to read a file from the direcory, but I see no 
> equivalent to
> check the root deployment directory.
> 
> Thanks in advance,
> Michal.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to