If I want to read in a file from a class which is NOT A SERVLET, how do I refer to it. Let me clarify this. If it was a servlet I could have got the context, and from there a relative path. BUT, from within a class there IS NO CONTEXT. For example, I am running weblogic. When I search for a file without specifying the path it searches from the "weblogic" directory, the place where I ran the startup script. I only know this to be true because after 1000 painfull attempts it finally loaded my xml file from that directory when I placed it there. How do you refer to a file from within a non servlet class? Here is my code to refer to the file I want to open:
File mappingfile = new File("character_mappings.xml");
Do I have to use an absolute reference to the System property "user.dir" ?