This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hello this may have already been asked so excuse me for redundancy. I would like to know how to access a file that is located in a virtual path on the server such as: \WEB-INF\classes\package\classes.cfg Whenever I try to access it either through the abs path or the relative path I get an IO error. I have a standalone app that needs to access the file and then communicate with the servlet. I am positive that I have done this before but my brain is so fried right now, I can't see straight Well I hope someone can help me clear this up, Im gonna get some dinner maybe that will help thanks in advance, EL Durango
use the relative path and pass it to the getRealPath method on the context object to get the full path and then open the file. also check your servlet container is setup to allow reading and writting files in the context by looking at the .properties file in the conf dir and adding an entry if needed.
Kim Jong II (North Korea's Dear Leader) said:Nuclear weapons don't kill people, people kill people.
Joined: Oct 09, 2003
Thanks Tim, I did realize that servletcontext was the best approach. It's now up and running. regards, El Durango
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: accessing files located in virtual server paths