简体   繁体   中英

Colon in the Property Placeholder

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM