Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2008

Tip: Looking for answers? Try searching our database.

Write in a file on server with jsp

Thread view: 
marga - 02 Mar 2008 23:20 GMT
Hello,
I am developing a simple jsp page, and I would like to write in a
test.txt File on server (on which I publish the page) and test.txt is
writable for all.
I don't know the absolute path where my web application resides.
I don't found nothing with Google.

Thanks,
Paolo
Arne Vajhøj - 03 Mar 2008 00:49 GMT
> I am developing a simple jsp page, and I would like to write in a
> test.txt File on server (on which I publish the page) and test.txt is
> writable for all.
> I don't know the absolute path where my web application resides.

application.getRealPath("/foobar.txt") will give you the real
path to http://yourserver/yourwebapp/foobar.txt !

I don't think this is a good solution.

You may not have write permission.

And it will not be multi user safe.

Arne


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.