Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Eclipse + Tomcat problem
Eclipse + Tomcat problem [message #200046] Sat, 17 March 2007 14:26 Go to next message
Eclipse UserFriend
Originally posted by: lvw.tlen.pl

Hi,
I've installed WTP Eclipse, and everything works well beside one matter:
when my servlet is saving a file by this code:
t.transform(new DOMSource(xmlDoc), new StreamResult(
new FileOutputStream("final.xml")));

the final.xml document is saved in the Eclipse main directory, how can I
adjust the properties to save this file in folder where the servlet is
running?

Thanks for answer.
Re: Eclipse + Tomcat problem [message #200468 is a reply to message #200046] Mon, 19 March 2007 15:55 Go to previous message
Eclipse UserFriend
Originally posted by: wayne.beaton._NOSPAM_eclipse.org

Open the run configuration ("Run > Run..." from the menu and select your
configuration on the left). Switch to the "Arguments" tab and set the
"Working Directory".

As a general rule, writing a file from a servlet is a bad idea.
Especially one with an absolute name. What happens when two users hit
the servlet at the same time? Or 100?

HTH,

Wayne

Kanan wrote:
> Hi,
> I've installed WTP Eclipse, and everything works well beside one matter:
> when my servlet is saving a file by this code: t.transform(new
> DOMSource(xmlDoc), new StreamResult( new
> FileOutputStream("final.xml")));
> the final.xml document is saved in the Eclipse main directory, how can I
> adjust the properties to save this file in folder where the servlet is
> running?
> Thanks for answer.
>
Previous Topic:Eclipse on Windows x64?
Next Topic:Eclipse Errors - what am I doing wrong
Goto Forum:
  


Current Time: Fri Apr 26 18:13:01 GMT 2024

Powered by FUDForum. Page generated in 0.08517 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top