RE: Servlet-aware service POJOs

From: Aron Gombas <aron.gombas@xxx.com>
Date: Tue Jul 26 2005 - 07:49:08 PDT

 Thanks, Alon, I took the path you suggested: I'm using
the standard Spring DispatcherServlet and my service POJO
implements the ContextAware interface, so the app-context
gets injected into it. In this specific case (servlet), this
is a WebApplicationContext object, so I can simply call the
ctx.getServletContext() method and I have the servlet-context
in the POJO.

 Aron Gombas
 CTO
 3NF Corporation
 www.3nf.com

-----Original Message-----
From: owner-hessian-interest@xxx.com
[mailto:owner-hessian-interest@xxx.com] On Behalf Of Alon J Salant
Sent: Wednesday, July 20, 2005 7:06 PM
To: hessian-interest@xxx.com
Subject: RE: Servlet-aware service POJOs

> My other idea was wiring things together through the Spring IoC
> container, where I could have Spring instantiate the objects and call
> the setters on both sides (servlet object <-> service object), but the

> servlet should be instantiated by the container I guess...

If you go this route, you will not use the HessianServlet. Spring
provides HessianServiceExporter in its place:
http://www.springframework.org/docs/reference/remoting.html. This will
allow you to do all your dependency injection with Spring.

Alon
Received on Tue 26 Jul 2005 07:49:08 -0700

This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:16:41 PDT