Announcement Announcement Module
Collapse
No announcement yet.
ClasspathResource with property placeholders? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ClasspathResource with property placeholders?

    Hi,

    I have some text file, which I treat as "ClasspathResource" (and I inject it into a bean that reads it).
    I'd like this text file to contain property placeholders.
    Is there some built-in support for it? Obviously I can write my own Resource implementation, but I wondered if there's already an existing one.

    The result should be something like:
    <bean class="MyReader">
    <property name="resource" ref="resource">
    </bean>

    where "resource" gives an input stream that reads "Hello, mister JOHN" that is constructed from the following file, injecting "JOHN" into the placeholder:
    // my.txt
    Hello, mister ${name}

    Thanks.
Working...
X