• Post Reply Bookmark Topic Watch Topic
  • New Topic

writing to property file  RSS feed

 
zohreh talebi
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,

I want to write in property file. i test the path and realPath and both of them are true but it doesn't work.

here is my code:


props.put(roomName, roomDescr);
String path = "/WEB-INF/"+ getServletContext().getInitParameter("chatpropertyfile");String realPath = getServletContext().getRealPath(path);
OutputStream fos = new FileOutputStream(realPath);
props.store(fos, "List of Rooms");
fos.close();
 
zohreh talebi
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help me .any idea can help me.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
....but it doesn't work.


That doesn't really give us much to work with.
What does happen?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope your actual code includes the try - catch structure to catch IOException and display the exception cause. Otherwise you are throwing away the information you need to debug the code.

Bill
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by zohreh talebi:
please help me .any idea can help me.


Please read this.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!