Accessing Nested Beans

0 views
Skip to first unread message

csprogrammer

unread,
Dec 22, 2008, 4:17:42 PM12/22/08
to ColdSpring-Users
Hey guys, when I was working with Spring a while back I remember you
could reference a nested object by setting the name of a field using
dot notation.

<input name="Report.Schedule.Frequency.frequencyId" value="WHATEVER"/>

Then inside your controller it would automatically call:

getReport().getSchedule().getFrequency().setFrequencyId(WHATEVER)

Is there a way to do this with ColdSpring or do I need to set the
value manually?

<cfset var Report = arguments.event.makeEventBean(getReportService
().new())/>
<cfset var frequencyId = arguments.event.getValue("frequencyId", 0)/>
<cfset Report.getSchedule().getFrequency().setFrequencyId(frequencyId)/
>

Thanks in advance for the help.

Robert

Brian Kotek

unread,
Dec 22, 2008, 4:52:04 PM12/22/08
to coldspri...@googlegroups.com
No ColdSpring doesn't do anything like that. In fact that sounds like something more related to the Spring MVC framework than it is for the core IoC container.

Barney Boisvert

unread,
Dec 22, 2008, 4:55:36 PM12/22/08
to coldspri...@googlegroups.com
Yeah, that's all the binding stuff that SpringMVC does for you.
Remarkably helpful stuff, not having to ever parse request parameters,
just get fully inflated objects from scratch.
--
Barney Boisvert
bboi...@gmail.com
http://www.barneyb.com/

csprogrammer

unread,
Dec 22, 2008, 5:26:58 PM12/22/08
to ColdSpring-Users
Thanks for the quick response. Very helpful.

Robert

On Dec 22, 3:55 pm, "Barney Boisvert" <bboisv...@gmail.com> wrote:
> Yeah, that's all the binding stuff that SpringMVC does for you.
> Remarkably helpful stuff, not having to ever parse request parameters,
> just get fully inflated objects from scratch.
>
>
>
> On Mon, Dec 22, 2008 at 1:52 PM, Brian Kotek <brian...@gmail.com> wrote:
> > No ColdSpring doesn't do anything like that. In fact that sounds like
> > something more related to the Spring MVC framework than it is for the core
> > IoC container.
>
> > On Mon, Dec 22, 2008 at 4:17 PM, csprogrammer <rcapp...@gmail.com> wrote:
>
> >> Hey guys, when I was working with Spring a while back I remember you
> >> could reference a nested object by setting the name of a field using
> >> dot notation.
>
> >> <input name="Report.Schedule.Frequency.frequencyId" value="WHATEVER"/>
>
> >> Then inside your controller it would automatically call:
>
> >> getReport().getSchedule().getFrequency().setFrequencyId(WHATEVER)
>
> >> Is there a way to do this with ColdSpring or do I need to set the
> >> value manually?
>
> >> <cfset var Report = arguments.event.makeEventBean(getReportService
> >> ().new())/>
> >> <cfset var frequencyId = arguments.event.getValue("frequencyId", 0)/>
> >> <cfset Report.getSchedule().getFrequency().setFrequencyId(frequencyId)/
>
> >> Thanks in advance for the help.
>
> >> Robert
>
> --
> Barney Boisvert
> bboisv...@gmail.comhttp://www.barneyb.com/
Reply all
Reply to author
Forward
0 new messages