Results 1 to 3 of 3

Thread: How to write to a properties file

  1. #1
    Join Date
    Aug 2004
    Location
    Stockholm
    Posts
    466

    Default How to write to a properties file

    Hi.

    Say I have a properties file declared somewhere in a similar fascin as this:

    Code:
    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    		<property name="location"><value>/WEB-INF/jdbc.properties</value></property>
    	</bean>
    How do yo, from inside say a Controller implementation, access and write to this file?
    Sincerely,
    /The Cantor

    "Murphy was an optimist"
    (The O'Toole commentary on Murphy's Law)

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    I don't think this is going to work as you intended. PropertyPlaceholderConfigurer is used at application context startup time, so the properties will have been configured by the time your Controller is available to service requests. Instead you'll need to find another way to update bean settings of an already running application context, such as via JMX.

  3. #3
    Join Date
    Aug 2004
    Location
    Stockholm
    Posts
    466

    Default

    OK.

    I'm not very familiar with JMX, have to check it up.

    So you're basically saying that there is no direct way of writing to a property holder att runtime? So I guess one is left with the old way of saving property files via a Stream of some sort then.

    Thanks, this is useful information.
    Sincerely,
    /The Cantor

    "Murphy was an optimist"
    (The O'Toole commentary on Murphy's Law)

Similar Threads

  1. FlowExecutionStorage in a DB
    By cacho in forum Web Flow
    Replies: 7
    Last Post: Oct 19th, 2009, 03:36 PM
  2. Saving large files to a db using hibernate?
    By Dan Washusen in forum Data
    Replies: 10
    Last Post: Sep 20th, 2006, 12:18 PM
  3. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  4. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  5. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM

Posting Permissions

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