Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
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.
Java Resources at
It is sorta covered in the
JavaRanch Style Guide
subject: create a file in the root directory
Saving file at server
Directory Creation on FTP Server using Java Program
Save a file on the application root
Creating a JAR file contains TLD-file.
Simple Servlet Not Working
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013