Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Finding the path to the program folder with JSP tags.
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?



Report this thread to moderator Post Follow-up to this message
Old Post
Tore Ottinsen
04-28-05 01:59 AM


Re: Finding the path to the program folder with JSP tags.
It 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.


Report this thread to moderator Post Follow-up to this message
Old Post
enrique
04-28-05 01:59 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Help archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:34 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.