tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Etienne" <etie...@sympatico.ca>
Subject RE: How to get the web application or Tomcat path inside a class (KMM37443975V57528L0KM)
Date Sat, 08 Feb 2003 01:11:32 GMT
Dear Jon Earthlink, 


My inquiry is already resolved.

E. L.


-----Original Message-----
From: support@earthlink.net [mailto:support@earthlink.net] 
Sent: February 7, 2003 5:48 PM
To: Francesa Lacreativa
Subject: RE: How to get the web application or Tomcat path inside a
class (KMM37443975V57528L0KM)

Dear Francesa Etienne,

We are unable to determine the nature of your inquiry from the
information you have provided. Could you kindly resubmit your concern?
Every attempt will be made to assist you as shortly as possible.


Why wait?  Resolve your customer service questions on-line at our
Account Maintenance web site.  To add email mailboxes, change passwords,
or update your credit card information, go to:

http://myaccount.earthlink.net

We also offer a wide variety of online self help options for technical
issues such as setting up your service, troubleshooting problems, or
just using the Internet and email, you can access clear, step-by-step
instructions at your Support Center:

http://support.earthlink.net


Jon E. 
Electronic  Support                      
EarthLink, Inc. 
Why Wait? Move to EarthLink. 
CSR ID#: 1286 
Case ID 20891569



Original Message Follows:
-------------------------

What about creating one more singleton object that is constructed with
the ServletContext, and then all of the other objects use that one to
access the file?  It's probably a good idea to encapsulate access to the
file anyway.
-- 
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW / 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863
> -----Original Message-----
> From: Etienne [mailto:etienno@sympatico.ca] 
> Sent: Friday, February 07, 2003 5:28 PM
> To: 'Tomcat Users List'
> Subject: RE: How to get the web application or Tomcat path 
> inside a class
> 
> 
> It is because the applications work with a lot of "interne" 
> singleton objects (one instance for all the application). 
> Like a ConnectionPool or a ApplicationScopeUtil that do not 
> need to know the actual request, of servlet context: this 
> would add a unused parameter to all the methods and mix up 
> everything, and maybe creating new thread problems... 
> 
> So, for now, I don't want to put inside each singleton object 
> a constructor asking for the ServletContext parameter... or 
> HttpServletRequest parameter... everything is working well 
> without any request indication. But when I need to get a file 
> on the drive, I need to know where is the tomcat path... That 
> is the only problem here. There is no way to get the 
> CATALINA_HOME of the JVM?
> 
> E.L
> 
> -----Original Message-----
> From: Tim Moore [mailto:tmoore@blackboard.com] 
> Sent: February 7, 2003 5:14 PM
> To: Tomcat Users List
> Subject: RE: How to get the web application or Tomcat path 
> inside a class
> 
> Why don't you have access to the ServletContext?  That's 
> really the only portable way to access resources in your webapp.
> 
> -- 
> Tim Moore / Blackboard Inc. / Software Engineer
> 1899 L Street, NW / 5th Floor / Washington, DC 20036
> Phone 202-463-4860 ext. 258 / Fax 202-463-4863
> 
> 
> > -----Original Message-----
> > From: Etienne [mailto:etienno@sympatico.ca]
> > Sent: Friday, February 07, 2003 5:01 PM
> > To: 'Tomcat Users List'
> > Subject: How to get the web application or Tomcat path 
> inside a class
> > 
> > 
> > Hi,
> > 
> > Is there a way to get the web application path or the tomcat
> > path inside a java bean not using any "Request" object? I am 
> > running tomcat on Windows. I need sometime to access xml file 
> > placed on the <web_app_path>/xml/ folder. On windows, it is 
> > easy to retrace them because the starting (default) path for 
> > retrieving a file is based on the web application path. So 
> > new File("xml/myfile.xml") works. 
> > 
> > But on the unix box, the starting (default) path is at
> > <tomcat_path>/bin/. I don't want to put my xml files there. 
> > So, is there a way (without the 
> > servletContext.getRealPath("//");  method, because I don't 
> > have access to the servletContext object ) to retrieve the 
> > path of the tomcat path or better,  the Web Application path?
> > 
> > tks
> > 
> > E.L.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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


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


Mime
View raw message