Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Write in a file on server with jsp

Reply
Thread Tools

Write in a file on server with jsp

 
 
marga
Guest
Posts: n/a
 
      03-02-2008
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
 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      03-03-2008
marga wrote:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JSP newbie - can I use JSP to access exiting java classes withoutre-write to javabeans terry433iid@yahoo.com Java 2 03-17-2008 01:40 AM
Declaring a variable in one JSP file and accessing it in another JSP file anubhakhurana@gmail.com Java 8 10-11-2006 01:15 AM
[JSP] difference between jsp:forward and jsp:include alexjaquet@gmail.com Java 0 06-02-2006 01:21 PM
jsp:include is not allowing me write scriptlet between <jsp:param> tags ramakrishna Java 0 05-04-2006 12:49 PM
how to write jsp custom tag that can have all kind of jsp elements(not only other tags but also srciplets) in his body Lukasz Indyk Java 1 09-22-2004 12:43 PM



Advertisments