The important thing to keep in mind is that the "object" parameter to the
"encoder" element is a hivemind reference, which means it can be a reference to
another hivemind service, or to a spring service.
<encoder id="foo"
object="service:FooHivemindServiceThatImplementsServiceEncoder"/>
or
<encoder id="bar" object="spring:BarSpringBeanThatImplementsServiceEncoder"/>
You can configure those beans in the usual way. My guess at what you want is
(using your example class names):
<service-point id="ViewGeographyEncoder"
interface="org.apache.tapestry.engine.ServiceEncoder">
<invoke-factory>
<construct class="my.fully.qualified.class.Encoder">
<set property="pageName" value="foo/Bar" />
<set property="url" value="/listings" />
<set-object property="utilities" value="spring:utils" />
</construct>
</invoke-factory>
</service-point>
<contribution configuration-id="tapestry.url.ServiceEncoders">
<encoder id="viewgeographyencoder" object="service:ViewGeographyEncoder" />
</contribution>
jeff
________________________________
From: Josh Long [mailto:[EMAIL PROTECTED]
Sent: Fri 10/20/2006 7:27 PM
To: Tapestry users
Subject: urgent: access a spring bean from a service encoder?
Hi all,
What's the best way to get access to a spring bean setup using the standard
context from isnide a service encoder?
I have the following (well, something like it: obviously the names have been
changed to protect the innocent..)
<encoder id="viewgeographyencoder" object="instance:
my.fully.qualified.class.Encoder
,pageName=foo/Bar,url=/listings,utilities=spring:utils"/>
Whcih doesn't yeild anything except stack traces. What's the correct way to
do this?
Thanks in advance for any help,
Josh