Code Comments
Programming Forum and web based access to our favorite programming groups.I'm making a program which uses JSP (custom tags) to get information from a form at the page and save it as an .xml document. I use apache Tomcat to run my program. Problem is, the .xml files are automatically saved where Java is run from, in my case C:/Windows/System32. That's not where I want the files at all. But I cannot use a direct path to the program folder within Tomcat, as this will differ depending on which computer the program is run on. I want to save the files in the program's main folder, where the JSP pages are located. How do I find the path to this folder? I've tried to search google for an answer, but everything I've found tells me to use 'getRealPath()', which is a method for servlets that does exactly this (I've used it for the same purpose before). But there is no servlet involved in this part of my program, only custom tags. Is there an equivalent of getRealPath for custom tags, or another easy way to do this?
Post Follow-up to this messageIt has been awhile since I've done any servlet programming, but look for a method called "getServletContext" or something like that. I think what you can do (in conjunction with this method) is -- using a url to a known JSP -- determine what the internal file path is to it. If I can better recall what to do, I'll write again.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.