path for FileWriter
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Damir_Aysin
Posted On:   Sunday, March 10, 2002 02:15 AM

I'm using Tomcat 4 [1] ../webapps/abc - my site and html-files [2] ../webapps/abc/WEB-INF/classes - folder for my servlets [3] ../webapps/db - folder for some files, as XSL or XML I have no problem with calling from [1] servlets stored in [2], but problem with follow: How to make path for FileWriter if I need to read/write files from [3]. Here is problem. When I'm using path as "c:/Tomcat4/webapps/abc/db" + FileName, servlets are working, but I wont to move my application to Internet, where I can't use this path. What I can do? Thank You, Damir    More>>

I'm using Tomcat 4

[1] ../webapps/abc - my site and html-files

[2] ../webapps/abc/WEB-INF/classes - folder for my servlets

[3] ../webapps/db - folder for some files, as XSL or XML


I have no problem with calling from [1] servlets stored in [2], but problem with follow:

How to make path for FileWriter if I need to read/write files from [3]. Here is problem.

When I'm using path as "c:/Tomcat4/webapps/abc/db" + FileName, servlets are working, but I wont to move my application to Internet, where I can't use this path.


What I can do?


Thank You,

Damir

   <<Less

Re: path for FileWriter

Posted By:   Anonymous  
Posted On:   Sunday, March 10, 2002 02:48 AM

Just check the documentation of the ServletContext class, and look for the method getRealPath(). It's exactly what you are looking for.


Regards

About | Sitemap | Contact