J
jazzdman
Hi,
I've been working on a webapp using Struts. I need to do some file
I/O in a few of my Action classes. Is there a way to do this easily?
What I mean is, is there an app(or server)-context relative way to read
files provided by Struts (or maybe even Tomcat)? A property I can read
or an object that does file I/O in a context relative way (ie something
like new File(mysteryObj.getServerDir()+"webbapps/my_app/foobar.txt")
instead of new File("/all/the/way/from/root/Tomcat
5.0/webapps/my_app/foobar.txt")) that I'm not aware of? The text books
I've read don't mention anything, and the Stuts website coughed up a
furball when I tried to search the Struts Users mailing list.
Thanks,
Jason Mazzotta
PS - Now that I think about it System.getProperty('user.dir') might be
a way to go, but is there a better way?
I've been working on a webapp using Struts. I need to do some file
I/O in a few of my Action classes. Is there a way to do this easily?
What I mean is, is there an app(or server)-context relative way to read
files provided by Struts (or maybe even Tomcat)? A property I can read
or an object that does file I/O in a context relative way (ie something
like new File(mysteryObj.getServerDir()+"webbapps/my_app/foobar.txt")
instead of new File("/all/the/way/from/root/Tomcat
5.0/webapps/my_app/foobar.txt")) that I'm not aware of? The text books
I've read don't mention anything, and the Stuts website coughed up a
furball when I tried to search the Struts Users mailing list.
Thanks,
Jason Mazzotta
PS - Now that I think about it System.getProperty('user.dir') might be
a way to go, but is there a better way?