Adding data in .properties file during runtime?
ok, so, i have a properties file that contains unlimited number of IP addresses:
IPAddress.properties
1=127.16.0.9
2=...
.
.
.
n
what i want to do here is to display the data from that file (using a jsp page) and at the same time let the end-user add, edit or delete the contents inside the property file. could that be possible? and can i use the <f:loadBundle> tag? i really need help...tnx.
nikaido,
Whilst .properties files where not really intended to be used this way I see no particular reason why you can't, for a SINGLE USER app... but if you're talking multiuser (even two) things tend to get ugly quicky... I suspect that you'd be better of just going to a DB.
Do you know how to save a properties file? There's a good tutorial on it here http://java.sun.com/docs/books/tutorial/essential/environment/properties.html
... and I spotted some nice example code at java ranch a while back with a really cool "properties for dummies" wrapper class, which makes the simple stuff really really simple.
Hope that helps.
Keith.