aspose file tools*
The moose likes JSP and the fly likes write to a file in war Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "write to a file in war" Watch "write to a file in war" New topic
Author

write to a file in war

igor kvak
Greenhorn

Joined: May 28, 2008
Posts: 17
my question is very simple, but I expect a complicated answer
I've got a .war file and in it .txt file (let's say: file.txt)
how can I write into file.txt?
thanks a lot


Never trouble trouble till trouble troubles you
Nickolas Case
Ranch Hand

Joined: Apr 26, 2008
Posts: 98
Are you trying to modify the file before deploying or while the application is running?
igor kvak
Greenhorn

Joined: May 28, 2008
Posts: 17
while the application is running
Nickolas Case
Ranch Hand

Joined: Apr 26, 2008
Posts: 98
Take a look at this thread from java.sun.com

Sun Forum
igor kvak
Greenhorn

Joined: May 28, 2008
Posts: 17
thanks for reply, but acording to the java.sun.com forum you have to restart server when you modify file.txt
and that is the problem
is there any other way?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

What is it that you are really trying to accomplish?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
igor kvak
Greenhorn

Joined: May 28, 2008
Posts: 17
i've got a jsp which can read from file.txt that is included in .war
when user do something on the jsp, i want to write something into that file.txt
server is running independently on my jsp so i cannot restart it (i've got free hosting)
that is all
Nickolas Case
Ranch Hand

Joined: Apr 26, 2008
Posts: 98
If I am not mistaken you only have to restart the server if your WAR is loaded into it's memory. I imagine since you have free hosting your WAR isn't using their memory and won't be locked.

Just a thought could be wrong...

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

That doesn't tell me anything more than I knew before. I ask again, what are you really trying to accomplish?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: write to a file in war