> -----Original Message-----
> From: Farr, Aaron [mailto:[EMAIL PROTECTED]
> > -----Original Message-----
> > From: Johan [mailto:[EMAIL PROTECTED]
> >
> > If you want keep things simple and clean I wouldn't go implementing
> > lifecyclesupport in the actions. Better is putting the businesslogic
> > inside Avalon and use the actions as a client of Avalon.
> 
> Hmm.  Perhaps it would be enough just to get the ServiceManager reference
> in
> the ServletContext.  This shouldn't be too hard.

I haven't had time to test this, since I have to run to an appointment, but
here's a very simple avalon-struts solution:

It's an extended ActionServlet that essentially uses the Fortress Servlet
example to load a container and then places it in the servlet context.  You
could then get the service manager in your actions via:

    ServletContext context = getServlet().getServletContext();
    ServiceManager manager = (ServiceManager)
               context.getAttribute(AvalonActionServlet.SERVICE_MANAGER);

There's a couple init parameters you can use to customize it.  It's not
perfect, for example, it requires you to use Fortress and specifically use
either the DefaultContainer or a derivative of this class.

I agree that the best, more flexible solution will be JNDI and hopefully
we'll have good solutions for that soon.  In the meantime I was just playing
around with these ideas.

The concept of adding Servlet support to Avalon is interesting though.
Wouldn't have to be just HTTPServlet support either.  Thought I'm not sure
what advantages this would have over just hosting jetty or tomcat.

jaaron


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to