This week's book giveaway is in the
We're giving away four copies of a choice of
"Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac"
and have Joe Kissell on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Take Control of Upgrading to Yosemite
Take Control of Automating Your Mac
this week in the
create a file in the root directory
Joined: Jul 31, 2008
Apr 20, 2009 13:07:05
based on some user action I need to create a file on the server inside the project's root directory. The url of my application is :
The name of the file is DeskItems.xml.
I tried to get the application Context path and appended that to the file name by using :
getServletContext.getPath("/") + "/DeskItems.xml";
But this approach is not working and I get an exception saying FileNotFound. I am using
Please help me out in resolving this issue.
SCJP 80% SCWCD 89%
Author and all-around good cowpoke
Joined: Mar 22, 2000
Apr 20, 2009 14:59:00
Look at the
getRealPath() method JavaDocs.
subject: create a file in the root directory
Simple Servlet Not Working
Save a file on the application root
Directory Creation on FTP Server using Java Program
Creating a JAR file contains TLD-file.
Saving file at server
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014