Hello Diego,

The syntax comes from Bash, a popular Unix shell.

http://www.faqs.org/docs/abs/HTML/parameter-substitution.html
http://www.purinchu.net/wp/2005/06/11/advanced-parameter-substitution-with-bash/
In short, ${varname:-word} means, if "varname" exists and isn't null,
return its value; otherwise return 'word'.

If my memory serves me correctly, the ${url-key:-url} syntaxt is
needed in Chapter 4, because while most database drivers take "url" as
the name of the parameter taking a url as a value, other database
drivers expect a different parameter name.

I hope this helps,


Diego Louzán wrote:
> In chapter4 of the documentation the following example is shown:
> 
> <dataSource class="${dataSourceClass}">
>      <!-- Joran cannot substitute variables
>           that are not attribute values. Therefore, we cannot
>           declare the next parameter like the others.
>      -->
>      <param name="${url-key:-url}" value="${url_value}"/>
>      <serverName>${serverName}</serverName>
>      <databaseName>${databaseName}</databaseName>
> </dataSource>
> 
> I can't figure out that special syntax for Joran in "${url-key:-url}", 
> can anybody explain it to me? Why is it needed in that example?
> 
> Regards.
> Diego.

--
Ceki Gülcü
QOS.ch is looking to hire talented developers located in Switzerland.
If interested, please contact c e k i AT q o s . c h
_______________________________________________
Logback-user mailing list
[email protected]
http://qos.ch/mailman/listinfo/logback-user

Reply via email to