Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Addresses #6 by allowing getBean() to resolve constants.

Add isSingleton=true metadata for constants.
  • Loading branch information...
commit 05b273067f91955152eab250ed934613e15e4f8a 1 parent 7478b41
@seancorfield authored
Showing with 3 additions and 2 deletions.
  1. +1 −1  ioc.cfc
  2. +2 −1  views/main/default.cfm
View
2  ioc.cfc
@@ -304,7 +304,7 @@ component {
if ( structKeyExists( variables.config, 'constants' ) ) {
for ( var beanName in variables.config.constants ) {
- variables.beanInfo[ beanName ] = { value = variables.config.constants[ beanName ] };
+ variables.beanInfo[ beanName ] = { value = variables.config.constants[ beanName ], isSingleton = true };
}
}
View
3  views/main/default.cfm
@@ -9,4 +9,5 @@
<cfdump var="#user2.getItem()#" label="User 2's Item Bean"/>
<cfdump var="#bf.getBean('userservice')#" label="User Service"/>
<cfdump var="#bf.getBean('product')#" label="Product Service"/>
-<cfdump var="#bf.getBean('userbean').product.getUserService()#" label="bf.getBean('userbean').product.getUserService()"/>
+<cfdump var="#bf.getBean('userbean').product.getUserService()#" label="bf.getBean('userbean').product.getUserService()"/>
+<cfdump var="#bf.getBean('magicvalue')#" label="bf.getBean('magicvalue')"/>
Please sign in to comment.
Something went wrong with that request. Please try again.