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.
Is there any sort of specifics as to where a servlet's "home" directory is? When my servlet writes a file, it seems almost arbitrary where it goes. On Tomcat it goes into the /bin directory while on JRun 2.3 it goes into the enclosing web server main directory. This is causing problems for me on JRun due to read/write security restrictions. I suppose it would be possible to give an absolute path, but this would destroy portability across even a single machine, let alone multiple Servlet Engines. Does anyone have any suggestions? Micah
Joined: Jun 11, 2001
Never mind. After some concerted searching on the rest of the board I found the getServletContext().getRealPath() stuff. Thanks to anyone who was going to help
Hmmm. I think you may have solved quite a few people's problems here. However, this isn't literally the "home" of the servlet - it's the absolute pathname for a given context (virtual path), so it's not for everyone. And they did note it breaks down if the item in question's inside a "WAR". Still, it's good to know...
Customer surveys are for companies who didn't pay proper attention to begin with.