I'm afraid that won't work, as bean injection occurs after the controllers
are created, so the beans scope is not populated when the constructor is
executed.

You should be able to achieve the same functionality by using an
onApplicationStart message listener instead. (Let me know if you'd like an
example of that.)

--
Ezra


On Thu, Jan 6, 2011 at 12:16 PM, byron <[email protected]> wrote:

> HI all.
>
> I have the following init function on a controller:
>
> <cfcomponent output="false" hint="I am a Model-Glue controller."
> extends="ModelGlue.gesture.controller.Controller"
> beans="participantService,mailService,applicationSettings">
>
>        <cffunction name="init" access="public" returnType="eHopeController"
> output="false">
>
>                <cfset variables.settings =
> beans.applicationSettings.getConfig() />
>
>                <cfreturn this />
>        </cffunction>
>
> other functions
>
> </cfcomponent>
>
> I'm getting the following error:
>
> Element APPLICATIONSETTINGS is undefined in a Java object of type
> class [Ljava.lang.String;.
>
> I've specified the bean correctly, because I can access the bean in
> other functions in this controller.
>
> Any ideas?
>
> Thanks
>
> Byron
>
> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<model-glue%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en
>

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to