Greetings all...
I'm trying to load and read a text file (on the server's filesystem)
from within a Struts application. I'd like to be able to put the file in
the WEB-INF, or the WEB-INF/classes directory, but am having trouble
finding the file (i.e. I'm having trouble obtaining the path that I
/reading a file from a Struts application...
Greetings all...
I'm trying to load and read a text file (on the server's filesystem)
from within a Struts application. I'd like to be able to put
the file in
the WEB-INF, or the WEB-INF/classes directory, but am having trouble
finding the file
Thank you...
I'll give it a try...
Cheers...
Dave
-Original Message-
From: Jarnot Voytek Contr AU HQ/SC [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 29, 2003 12:02 PM
To: 'Struts Users Mailing List'
Subject: RE: Opening/reading a file from a Struts application...
-Original
On Tue, 29 Jul 2003, Davide Bruzzone wrote:
Date: Tue, 29 Jul 2003 11:57:41 -0600
From: Davide Bruzzone [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Opening/reading a file from a Struts application
: Opening/reading a file from a Struts application...
-Original Message-
From: Jarnot Voytek Contr AU HQ/SC
Sent: Friday, June 27, 2003 11:53 AM
To: 'Struts Users Mailing List'
Subject: RE: getting a file path to /WEB-INF from a HttpSession
try
request.getSession(false).getServletContext
Mailing List
Subject: Re: Opening/reading a file from a Struts application...
On Tue, 29 Jul 2003, Davide Bruzzone wrote:
Date: Tue, 29 Jul 2003 11:57:41 -0600
From: Davide Bruzzone [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL
You can load Properties files like this:
java.io.InputStream in = baseClass.getResourceAsStream(fileName);
Properties props = new Properties();
props.load(in);
I use this with my base classes, as the have to work outside my Tomcat,
too, that's what base classes for, after all.
Have
7 matches
Mail list logo