views:

72

answers:

1

I want to reuse vars setted once again later in Config.groovy

Example:

static.serverURL = "http://static.foo.com"
static.path = ""

bar.default.picUrl=static.serverURL+static.path+"/images/bar.png"

but that gives me a

groovy.util.ConfigObject.plus() is applicable for argument types: (java.lang.String)

changing it to

bar.default.picUrl=""+static.serverURL+static.path+"/images/bar.png"

gives me

[:][:]/images/bar.png

using

bar.default.picUrl=${static.serverURL}+${static.path}+"/images/bar.png"

gives me

nullnull/images/bar.png
A: 

Did you try:

bar.default.picUrl="${static.serverURL}${static.path}"/images/bar.png
Mike