Re: [Actionframework-users] parameters to output-variable methods
Status: Inactive
Brought to you by:
ptoman
From: Craig L. <cr...@be...> - 2002-08-08 14:15:59
|
On Wed, 2002-08-07 at 15:39, Petr Toman wrote: > > is there any way to pass parameters to the methods that > > output-variable defined values call? for eg: > > > > <output-variable name=3D"objectList" component=3D"objectHandler" > > value=3D"getObjectList(Context context)"/> >=20 > Sure! You can use $variables in method calls in <in/output-variable>s: >=20 > <output-variable name=3D"objectList" component=3D"objectHandler" > value=3D"getObjectList($context)"/> >=20 > ....supposing that $context is already in the context. ah, ok. that wasn't clear from the tutorial. i guess the tutorial showed that you could put $xxx as the value, i didn't make the leap to assume i could use them as parms in a method call though. i was expecting the calls there to work like the 'method' attribute of the 'action' element. just as an aside, does putting a reference to the context IN the context open one up for a memory leak? or is the vm smart enough to know if a reference to something is from something that is ready to be destroyed anyway? i suppose putting a reference to the context in the context isn't a real security concern, you couldn't use that reference in the template to do anything that a template wouldn't be able to do otherwise, would it?=20 the context to a template is almost like the 'this' pointer in a method i guess, you always use it whenever you use a '$' operator anyway. > Components created by DefaultInstantiator can have constructor with > a parameter ActionServlet (or its subclass), so you can pass the servlet > reference to the component. ok, i see that now to. i was just getting to point in the thinking process that i might need to create my own instantiator, which would have made this obvious once i looked at the javadoc. thanks for taking the time to answer these, i'm slowly getting my head everything! sincerely, --=20 CraigL->Thx(); Be Developer ID: 5852 |