Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Colon in the Property Placeholder

Tags:

java

spring

In our application we have bean configuration in XML file. In XML file I found this line:

<jee:jndi-lookup id="myVar"
                 jndi-name="java:jboss/application/myVar"
                 default-value="${application.myVar:}"/>

Value of ${application.myVar:} is stored in properties file.

What does colon after application.myVar mean?

like image 391
winnfield Avatar asked Apr 18 '14 11:04

winnfield


1 Answers

First of all there is nothing about JSTL.

The expression ${...} comes from <property-placeholder/>.

The colon means a delimiter between value from property placeholder and the default value. For example your case:

application.myVar the key to resolve value from properties file.

'the empty string after colon' - the default value, if application.myVar doesn't exist or is empty.

like image 154
Artem Bilan Avatar answered Sep 30 '22 07:09

Artem Bilan