GetResourceAsStream() vs FileInputStream?

The java.io. File and consorts acts on the local disk file system. The root cause of your problem is that relative paths in java.io are dependent on the current working directory.

I.e. The directory from which the JVM (in your case: the webserver) is started. This may for example be C:\Tomcat\bin or something entirely different, but thus not C:\Tomcat\webapps\contextname or whatever you'd expect it to be.

In a normal Eclipse project, that would be C:\Eclipse\workspace\projectname . You can learn about the current working directory the following way.

GetResourceAsStream is the right way to do it for web apps (as you already learned).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions