To persist property values for later use, provide a persist-key attribute for the property, as shown in this example:

<property-file file="atg/PropFile.properties">
  <property-group id="base">
    <property name="someProp" persist-key="someKey">
      <value>Default value</value>
        <input type="text">
          <label>Prompt to the user</label>
        </input>
      </value>
    </property >
  </property-group>
</property-file>

At runtime, if the key references a valid persisted value, that value is used as the default presented to the user. If the reference does not exist, the value tag is used as the default instead. In both cases, the user input is persisted to the persist-key specified.

You can also use previously persisted values in a property. In the following example, the second property file has a lockServerPort property that uses the persisted value from the first property file. Note that the order is significant; you cannot use a persisted value before it is persisted, so the first time the persisted value is referenced, the input element must be declared.

<property-file file="/atg/dynamo/service/ServerLockManager.properties">
  <property-group id="lock">
    <property name="port" persist-key="managementServerLockManagerPort">
      <value>9010</value>
      <input type="text">
        <label>Enter Lock Server Port</label>
        <validator id="PortNumberInputValidator">
          <error-message>Invalid Port Number</error-message>
        </validator>
      </input>
  </property>
</property-group>
</property-file>
  <property-file file="/atg/dynamo/service/ClientLockManager.properties">
    <property-group id="base">
      <property name="lockServerAddress">
        <value>localhost</value>
    </property>
    <property name="lockServerPort" persist-
key="managementServerLockManagerPort"/>
    <property name="useLockServer">
      <value>true</value>
      </property>
    </property-group>
</property-file>

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices