| Author |
getResourceAsStream returning null
|
Sat Nar
Ranch Hand
Joined: Oct 22, 2004
Posts: 83
|
|
Hi, I am reading a config file from a java program. Below is the code. str = loader.getResourceAsStream(filename); It is returning a null. I have placed the file under WEB-INF and also tried placing it under WEB-INF classes. But still its returning a null. Kindly help me out. Thanks
|
 |
Santosh Raveendran
Ranch Hand
Joined: Jun 29, 2008
Posts: 83
|
|
can you make your requirement clear,why You need to read it as byte stream? do You need to send this file to some location or response or You need to read the data from the file ------------- Santhosh
|
SCJP 1.4,SCWCD5, SCBCD5
Thanks, Santhosh
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56202
|
|
Perhaps it might be useful for you to let us know what filename is set to? And if you are placing the file under WEB-INF rather than in the classpath, you should be using the ServletContext rather than the class loader.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: getResourceAsStream returning null
|
|
|