I've used the one described on spring manual
Create a Base engine for you
Let's say SpringBaseEngine
public class SpringBaseEngine extends BaseEngine {
private static final long serialVersionUID = 3905241217045443380L;
public static final String APPLICATION_CONTEXT_KEY = "appContext";
protected void setupForRequest(RequestContext context) {
super.setupForRequest(context);
Map global = (Map) getGlobal();
ApplicationContext ac = (ApplicationContext)
global.get(APPLICATION_CONTEXT_KEY);
if (ac == null) {
ac = WebApplicationContextUtils.getWebApplicationContext(
context.getServlet().getServletContext()
);
global.put(APPLICATION_CONTEXT_KEY, ac);
}
}
}
define your engine for your application:
<application engine-class="com.mgjug.view.engine.SpringBaseEngine" >
You're almost there...
in your component :
<property-specification name="userService"
type="net.sf.webfeeds.services.service.user.UserService">
page.global.appContext.getBean("userService")
</property-specification>
Ok, it depends on your page, but which component isn't contained by one?
>From now on is pretty straightforward. Your services get your daos
injected as well other dependencies
I'm looking forward Tapestry + Hivemind. I'll give a shot next week
and post an example
Regards
On 6/29/05, Tapestry Stuff <[EMAIL PROTECTED]> wrote:
> Hi, new guy around here.
>
> Can anybody point me to a resource describing the canonical pattern
> for integrating Spring with Tapestry 3? Hibernate is in use but
> (correct me if I'm wrong) if one can work the Spring problem out then
> Hibernate will be easy.
>
> Also, planning on building components that use Spring beans - what is
> the best way to inject beans into these components regardless of the
> page they reside in?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]