This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

write to a file in war

 
igor kvak
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Nickolas Case
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you trying to modify the file before deploying or while the application is running?
 
igor kvak
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
while the application is running
 
Nickolas Case
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at this thread from java.sun.com

Sun Forum
 
igor kvak
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64186
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is it that you are really trying to accomplish?
 
igor kvak
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64186
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That doesn't tell me anything more than I knew before. I ask again, what are you really trying to accomplish?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic