File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Write to server outside web application? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Write to server outside web application?" Watch "Write to server outside web application?" New topic
Author

Write to server outside web application?

joseph corner
Ranch Hand

Joined: Feb 20, 2004
Posts: 50
Hi,
Is there a way to write to a file on the server outside the JSP's web application folder?
Thanks!
J
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

Yes, you can use normal Java I/O to write a file anywhere you have permissions to. Is there a bigger issue you didn't mention?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
joseph corner
Ranch Hand

Joined: Feb 20, 2004
Posts: 50
Hi,
the permissions thing is what concerned me. In a web app. that end users will be hosting on their own servers, how do I know that I will have the required permissions outside the web app. folder?
Thanks, J
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

Of course your code should handle any permission failures gracefully, but beyond that it's sort of out of your control. As part of the installation of your application, you should ensure that the appropriate file structures have the required permissions.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Write to server outside web application?
 
Similar Threads
Where to place non java files in a WAR archive?
How to create an output/log file from a servlet contained in a WAR?
Servlet not receiving any data
Can I write to a directory outside the j2ee container?
Can I use JSTL within a Servlet?