ooo thanks Barney. I thought CS did exactly what you say, a string replace
on the actual XML text before it parsed it. Thanks!

On 7/3/07, Barney Boisvert <[EMAIL PROTECTED]> wrote:

You can't do that.  Property substitutions are only for
property/constructor-arg values.  I.e. they're not done in a "string
replace" fashion, but in an "value replace" fashion.  If you want to
parameterize other parts of the XML, you have to use some other
mechanism.

There are a wide array of ways to do that, the simplest of which is to
just give your XML a .CFM extension, and then CFSAVECONTENT/CFINCLUDE
it to load it so that it'll run through the CFML engine.  It's kind of
kludgey, but it works, and it'll give you the full power of CFML for
building the XML.

cheers,
barneyb

On 7/3/07, Nicholas Vacek <[EMAIL PROTECTED]> wrote:
> How do use a variable Component Path for my bean definitions?
>
> An example bean definition:
>
> <beans>
>         <bean id="Calculators" class="Components.Calculators"
singleton="true">
>         <constructor-arg
> name="datasource"><value>${datasource}</value></constructor-arg>
>         </bean>
> </beans>
>
> I put all my CFC files into a folder called "components", within the
> webroot. Thus this file path needs to be in the class attribute of the
> bean definition, in order for ColdSpring to find the cfc's.
>
> I've figured out how to pass in a datasource to my ColdSpring
> BeanFactory, so my config file can be modular/reusable/etc. But I'd like
> the Component Path be a variable too, and I can't figure out how to do
> it. This code causes errors with ColdSpring:
>
> <beans>
>         <bean id="Calculators" class="${componentPath}.Calculators"
> singleton="true">
>         <constructor-arg
> name="datasource"><value>${datasource}</value></constructor-arg>
>         </bean>
> </beans>
>
> Thanks in advance for any help you can give!
>
>
> --
> Nicholas Vacek
> Vivid Image - Programmer
> 320-587-8974 ext. 111
> [EMAIL PROTECTED]
> http://www.vimm.com


--
Barney Boisvert
[EMAIL PROTECTED]
http://www.barneyb.com/

Got Gmail? I have 100 invites.


Reply via email to