I've got a bit of a problem that someone out there might be able to help me with. I'm trying to read the contents of a directory relative to the location of a JSP page. Let me give you the specifics.
I have a project on my local machine. The project is located in the "c:/public_html" directory. I'm trying to read files in the "c:/public_html/jpegs/standard/" directory. Now on my local machine this all runs like a champ using the following code in a JSP located in the "c:/public_html" directory.
Now here's where the problem comes in. When I move this code to my hosting service I get a Null pointer error from the dir variable when using list(). It appears that getContextPath is returning a null value. What I'm attempting to do is write my code in such a way that I don't have to make any changes going from my local test environment to my production environment on my hosting service. Any suggestions or ideas?