> From: Qiao Jin [mailto:bra...@gmail.com] > Subject: RE: application.getRealPath() in JSP from a subdirectory > > Could you elaborate a bit on your statement: "Using > getRealPath() inside an app server of any kind is > pretty much always a Bad Idea"?
The container (app server) is under no obligation to provide access to the file system, other than the workspace area indicated by the javax.servlet.context.tempdir ServletContext attribute. The container may be running on a platform that does not even have a file system (e.g., a router), some webapps may be deployed only in memory, or the webapp may be deployed via an archive of some sort. While getRealPath() likely will work when you're in complete control of the execution environment, you cannot count on it in general. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org