struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: File I/O with Struts
Date Thu, 07 Sep 2006 23:42:18 GMT
Asad Habib wrote:
> I am trying to read from a file using a utility class that I invoke from 
> an action. However, my application is unable to find the file and a 
> java.io.FileNotFoundException is thrown. I have tried placing the file 
> in /WEB-INF/classes as well as the root directory of the application 
> however the error is still thrown. Any help would be appreciated. Thank 
> you.

It's hard to help without seeing the code, but you are probably 
specifying an incorrect path to the file. Are you using getRealPath() 
[1] to figure out the real file location?

L.

[1] 
http://tomcat.apache.org/tomcat-5.0-doc/servletapi/javax/servlet/ServletContext.html#getRealPath(java.lang.String)


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


Mime
View raw message