This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Inside of a web application you need to absolute paths, not relative paths like "test.txt", because a web app has no notion of a default directory. Or are you actually using "S:\\test.xt" as path? You could investigate by having the JSP print out the full path.
Thanks for replying. I did use the absolute path "s:\\test.txt" . If I put the file on my local drive and I put "C:\test.txt" in FileReader(), it works. If I put the file to S drive which is a mapped network drive and put "S:\test.txt" in FileReader(), it does not work.
There are something related to Tomcat login user permission. Do you think so?
Joined: Mar 22, 2005
I'm not all that familiar with using Windows network drives in Java, but you can try using the UNC naming convention, i.e. "\\server\share\file_path" instead.