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.
You can get the file path to the context from the ServletContext, provided it is not packaged as a WAR (not a good idea to make this assumption without checking) but you're right that the ClassLoader will not let you browse outside the entries on the classpath.
Joined: Jan 14, 2009
Yes I can found the file path to the context but if I try file.exist() the function return false to me ... The URI is correct but it seems, that it seems invisible.
I can also retrieve the path by ClassLoader but same problem occurred ...
Do you to a method like ServletContext.getResourceAsStream, but returning an outputstream of my file instead inputstream ?