Results 1 to 2 of 2

Thread: How to add a key-value in ApplicationResource.Properties

  1. #1

    Default How to add a key-value in ApplicationResource.Properties

    Hi
    Please send me some code snippet on how to add a new key-value pair in ApplicationResource.propertis file.Im developing a tool which will help in managing the ApplicationResource.properties , Im using the struts framework to attain this.This will make a user to define his own key value pairs....

    Regards
    Kiran Kumar [/code]

  2. #2
    Join Date
    Aug 2004
    Location
    Roeselare, Belgium
    Posts
    16

    Default

    If you really want to let users mess around with your properties files, you can use standard java code like
    Code:
    java.util.Properties.load(file)
    And then call setProperty(). You can also save the Properties object back to file.

    Beware however that this save will remove any comments or ordering that you have in the file. I suggest you use two properties files, one which won't change (i18n for your code) and one that users can mess around with.
    Pieter Coucke
    Onthoo.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •