Web apps do not have a concept of a "current directory", in particular not one tied to the currently executing class. It may be the root of the web app, but that's not specified, so you can't rely on it. That's why you need to use absolute paths in web apps.
Joined: Nov 05, 2008
Actually i realized that its eclipse that does that 'Create in context root' thing ..